Today's the day

向软件大牛炫耀我会焊单片机,向硬件大牛炫耀我会写 Rails,向软硬件大牛炫耀我生物,向软硬件生物大牛炫耀我会折腾期货 -_-bbb

Nginx + Passenger 也不错
Psych、Syck、YAML 和编码

重新审视 Vim

galeki posted @ 2010年9月24日 07:45 in RoR with tags vim , 13284 阅读

虽然号称使用 Vim 多年,但是实际上一直没有仔细研究过,平常用的也就是 Vim 的基本快捷键而已,虽然经常写 Rails 代码,但是除了自己定义了一个在 erb 文件中输入 <%= %> 代码的快捷键之外,就没有任何其他配置了,插件也只是偶尔用用 NERDCommenter 之类。

最丢人的是,目前还不习惯用 hjkl 移动,因为平常也经常用其他的普通编辑器,所以即使在 Vim 下,每次也都是用着用着就去摸箭头键了,至今没有调整过来。

不过前天看到一篇非常好的 Vim 文章:

Coming Home to Vim / Steve Losh

受其影响,开始重新审视 Vim。

文章中提到的一些 Tips 比较有启发性,比如对于不知不觉去摸箭头键而不使用 hjkl 的问题,可以用下面的配置代码,将箭头键屏蔽:

nnoremap <up> <nop>
nnoremap <down> <nop>
nnoremap <left> <nop>
nnoremap <right> <nop>
inoremap <up> <nop>
inoremap <down> <nop>
inoremap <left> <nop>
inoremap <right> <nop>

这样每次就会被强迫去用 hjkl 了,对于 Vim 初学者来说尤其实用。

此外,对于回到命令模式用的 Esc 太远的问题,除了通过某种方法把无用的 CapsLock 键映射为 Esc 之外,还可以使用“jj”:

inoremap jj <ESC>

因为单词中很少有输入 jj 的情况,所以并不会干扰输入。映射为“,,”也可以,当然也可以使用脚踏板 :)。

此外还知道了一个可以像 TextMate 那样智能打开文件的插件 PeepOpen

虽然要收费,但是效果比 Command-T 之类的要好多了,所以等有了资金就去买一个用。有了这个东西,NERDTree 之类的就不需要了~ :)

最后,就是再定义一些快捷键了,Vim 的快捷键定义语法 nnoremap 和 inoremap 非常直观,一直都想不出应该定义什么真是不应该啊。

Avatar_small
依云 说:
2010年9月24日 08:58

PeepOpen是Mac专用的啊,我还是安心地用Lusty-explorer + mru.vim好了。那几个映射到 <nop> 的键映射很不错,以后一定要给初学者推荐 :-)
BTW,“全局相关文章”里有两篇文章都是我的呵~

Avatar_small
galeki 说:
2010年9月24日 13:47

是啊,PeepOpen 是个外挂程序,所以还支持 Emacs 什么的。
因为都打了 vim 的 tag,所以就自动关联到了一起啦~ :)

Avatar_small
蓝色基因 说:
2010年9月24日 18:17

请问页面下面的 “全局相关文章” 是怎么弄出来的?

Avatar_small
galeki 说:
2010年9月24日 21:22

在工作台的 外观->文章底栏 下面可以找到设置~

Avatar_small
蓝色基因 说:
2010年9月24日 22:07

要是你还是适应不了 hjkl 的按键,我写了一篇关于这个的文章:

http://bluegene8210.is-programmer.com/posts/21509.html

希望能对你有帮助。

Avatar_small
galeki 说:
2010年9月25日 03:24

这个方法也不错,让我想起了格斗游戏~

aobatu 说:
2010年11月17日 05:43

这个模板好漂亮!

Raze unblocked game 说:
2018年4月27日 17:33

The article you have shared here very awesome. I really like and appreciated your work. I read deeply your article, the points you have mentioned in this article are useful

deadpool 2 jokes 说:
2018年6月05日 14:58

Your writing very well and provide a lot of useful information. But if you tap water more than half as compared to another article, I would definitely be great

bodak yellow lyrics 说:
2018年7月02日 16:34

This one is great. keep doing awesome! download any track!

Superfighters 说:
2019年2月01日 12:16

I love to read your article and get so much information through your blog and learn new thing about blogging

Latest 2019 Songs 说:
2019年2月16日 05:35

Whoa! This blog looks exactly like my old one! It's on a completely different topic but it has pretty much the same page
layout and design.

MHR Writer UK 说:
2019年9月28日 15:02

I think it could be more general if you get a football sports activity

Robinjack 说:
2020年11月11日 22:08

There are solutions by which exceptional behavior procedures are employed more info to support folks recognize the particular desire to draw tresses prior to urge gets far too formidable for you to fight. The patient finds approaches to withstand the actual want so the actual need becomes less strong then goes away completely. best smm panel

Robinjack 说:
2020年11月14日 17:57

It is challenging to discover knowledgeable people on this subject, but you sound like you know what you are talking about! Thanks Get well soon

sauna 说:
2021年5月30日 18:30

I was impressed with the site that you created, so memotipasi many people to be more advanced, there also kunjugi me, as a comparison sauna

no excuses runner 说:
2021年5月31日 17:45

Thankyou for sharing the data which is beneficial for me and others likewise to see. credit

Door installation Co 说:
2021年6月03日 16:49

Thankyou for sharing the data which is beneficial for me and others likewise to see. Door installation Companies

Indoor sauna 说:
2021年6月06日 21:23

Extraordinary things you've generally imparted to us. Simply continue written work this sort of posts.The time which was squandered in going for educational cost now it can be utilized for studies.Thanks Indoor sauna

Faddy 说:
2021年6月08日 20:57

Such a very useful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. Face mask

Hammad Amir 说:
2021年9月23日 17:21

What a fantabulous post this has been. Never seen this kind of useful post. I am grateful to you and expect more number of posts like these. Thank you very much. น้ำยาบุหรี่ไฟฟ้า pod

AAA 说:
2021年11月05日 17:32

it has the seriously brilliant site. it has the realy informational including a this sort of fine occupation. everyone loves the following. how long does shein take to ship

AAA 说:
2021年11月09日 20:11

Brilliant text. A posting has effects on loads of imperative complications one's world. Most people can't be uninvolved so that you can every one of these complications. The next posting supplies plans plus basics. Pretty enlightening plus simple. Home improvement

. 카지노사이트 说:
2022年2月24日 02:38

Thanks for taking the time to discuss that, I feel strongly about this and so really like getting to know more on this kind of field. Do you mind updating your blog post with additional insight? It should be really useful for all of us. slotxo โปรสมาชิกใหม่

. 카지노사이트 说:
2022年2月25日 03:04

It is a fantastic post – immense clear and easy to understand. I am also holding out for the sharks too that made me laugh. Telephonic Interpreters

. 카지노사이트 说:
2022年3月08日 02:58

Nice to read your article! I am looking forward to sharing your adventures and experiences. elo boost wild rift

. 카지노사이트 说:
2022年3月18日 03:12 I’ve been surfing online more than three hours today, yet I never found any interesting article like yours. It’s pretty worth enough for me. In my opinion, if all webmasters and bloggers made good content as you did, the web will be a lot more useful than ever before. Toepassingen voeding industrie
. 카지노사이트 说:
2022年3月18日 03:13

n fascinating discussion is value comment. I think that it is best to write extra on this matter, it won’t be a taboo topic however generally people are not enough to talk on such topics. To the next. Cheers Toepassingen Logistiek en transport

. 카지노사이트 说:
2022年3月19日 03:13

We are really grateful for your blog post. You will find a lot of approaches after visiting your post. I was exactly searching for. Thanks for such post and please keep it up. Great work. Covid testing at home

PEBC 说:
2022年3月19日 20:18

Thank you a bunch for sharing this with all people you actually know what you are talking approximately!

. 카지노사이트 说:
2022年4月24日 01:09

I just found this blog and have high hopes for it to continue. Keep up the great work, its hard to find good ones. I have added to my favorites. Thank You. Cheap smm panel

. 카지노사이트 说:
2022年4月26日 05:27

I appreciate everything you have added to my knowledge base.Admiring the time and effort you put into your blog and detailed information you offer.Thanks. Judiking88

. 카지노사이트 说:
2022年5月10日 02:13

Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. Stamped Concrete Nashville TN Stamped Concrete Near me

COOK 说:
2022年5月15日 03:41

Thanks for another wonderful post. Where else could anybody get that type of info in such an ideal way of writing? 먹튀검증

COOK 说:
2022年5月29日 01:49

I found this is an informative and interesting post so i think so it is very useful and knowledgeable. I would like to thank you for the efforts you have made in writing this article. judi online

. 카지노사이트 说:
2022年5月30日 03:06

This is a smart blog. I mean it. You have so much knowledge about this issue, and so much passion. You also know how to make people rally behind it, obviously from the responses. 신촌룸싸롱

COOK 说:
2022年6月07日 23:29

I have recently started a blog, the info you provide on this site has helped me greatly. Thanks for all of your time & work. Kirkland, WA Commercial Pest control Service

Harry 说:
2022年7月27日 22:07

It really looks great, I've seen many other posts, that's the info I needed, thanks for sharing. spbo

Food Security Card 说:
2022年7月31日 13:26

The Food Security Card is also known as Ration Card provides to the middle-class income group and economically backward group to get the ration at subsidy rates. <a href="https://99employee.com/food-security-card-apply-search-fsc/">Food Security Card</a> The purchase of pulses and other essential commodities of the kitchen may provide at very low cost in the Ration Shops placed by Government at a subsidy rate. It is also proof of the identification of an individual and their family in India. Every Government application or any address proof will ask for a Ration Card as an option to prove your identity. The motive of this card is to provide support to economically backward class people, by which they can have their livelihood without much difficulty. Here 99employee will provide some details about FSC, just check-in

Food Security Card 说:
2022年7月31日 13:27

The Food Security Card is also known as Ration Card provides to the middle-class income group and economically backward group to get the ration at subsidy rates. Food Security Card The purchase of pulses and other essential commodities of the kitchen may provide at very low cost in the Ration Shops placed by Government at a subsidy rate. It is also proof of the identification of an individual and their family in India. Every Government application or any address proof will ask for a Ration Card as an option to prove your identity. The motive of this card is to provide support to economically backward class people, by which they can have their livelihood without much difficulty. Here 99employee will provide some details about FSC, just check-in

. 카지노사이트 说:
2022年8月05日 02:38

I am happy to find this post Very useful for me, as it contains lot of information. I Always prefer to read The Quality and glad I found this thing in you post. Thanks facebook login and sign in


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter