Live data from Hacker News

Vim: revisited

mislav.uniqpath.com

31–40 of 117 posts

Re: Vim: revisited

#31

If only I had read this when I first started using Vim! I've been using Vim for a while, and this is one of the best-organized overviews of Vim I've seen, partly because he doesn't try to enumerate every single key combination (which is the wrong way to learn Vim - the right way is to synthesize the way that the individual operations are logically combined, though that admittedly takes some time). The best two pieces…

I agree about accepting (most) standard key bindings, but here are two clever bindings I adopted:

  " Enter command mode with SPACE instead of :
  noremap  :

  " Exit insert mode with jj (double J) instead of ESC
  imap jj 

Re: Vim: revisited

#32

If only I had read this when I first started using Vim! I've been using Vim for a while, and this is one of the best-organized overviews of Vim I've seen, partly because he doesn't try to enumerate every single key combination (which is the wrong way to learn Vim - the right way is to synthesize the way that the individual operations are logically combined, though that admittedly takes some time). The best two pieces…

I agree about accepting (most) standard key bindings, but here are two clever bindings I adopted: " Enter command mode with SPACE instead of : noremap : " Exit insert mode with jj (double J) instead of ESC imap jj

I use backspace as a substitute for ESC. I find ESC awkward to locate while typing, but backspace is easy.

Re: Vim: revisited

#33

I use and like Vim, but I feel like the articles that make it to HN all say the same thing ("I had a conversion experience," followed by some configuration details, followed by basic keystrokes, etc). Why does everyone feel the need to re-tell the same story?

The stories aren't the same, though.

This story is pretty different from, say, Yehuda Katz's story about switching to Vim.

I find all the different takes interesting, and I think you can casually learn from the differences between them.

Re: Vim: revisited

#34
post #27
post #26

Earlier quoted context omitted.

The thing about vi vs emacs is that at the very beginning the learning curve for vi is already very steep. Simple things like keyboard navigation and even editing are non-trivial tasks. This puts off a lot of people, especially if they're working full time as a couple of days fumbling with a text editor equates to real dollars lost in productivity. (In my experience though, it'll take at least a few weeks to be even…

I don't think the initial difficulty of Vi is that much greater than that of Emacs. The real difficulty is in the fact that everything is completely different from what you are used to; perhaps this is more true in Vi, but the difference between Emacs and Vi in this regard pales in comparison to the difference between using a mouse and arrow keys and either of the text editors. Also, while my approach will certainly…

I use VIM and sometimes use the arrow keys. These come in really handy when you have a lot of small edits to make that can't be readily automated (not really that frequent).

However the huge shift in mentality has to go from the idea that you are working with a "text editor" (which VIM and EMACS are not IMHO) and a text processor which I would argue these are.

When you start thinking about processing rather than editing text, the productivity goes way up. There is nothing like these tools in the text editor world for editing large, complex codebases. IDE's can't compare.

Re: Vim: revisited

#35

If only I had read this when I first started using Vim! I've been using Vim for a while, and this is one of the best-organized overviews of Vim I've seen, partly because he doesn't try to enumerate every single key combination (which is the wrong way to learn Vim - the right way is to synthesize the way that the individual operations are logically combined, though that admittedly takes some time). The best two pieces…

I agree about accepting (most) standard key bindings, but here are two clever bindings I adopted: " Enter command mode with SPACE instead of : noremap : " Exit insert mode with jj (double J) instead of ESC imap jj

I used jj for a while as well, but once I found out that ctrl-C did the same thing out of the box, that became my "esc" key> (it's also important to remap caps lock to control, on the mac its easy: System Preferences->Keyboard->Keyboard->Modifier Keys)

Re: Vim: revisited

#36

Earlier quoted context omitted.

I agree about accepting (most) standard key bindings, but here are two clever bindings I adopted: " Enter command mode with SPACE instead of : noremap : " Exit insert mode with jj (double J) instead of ESC imap jj

I used jj for a while as well, but once I found out that ctrl-C did the same thing out of the box, that became my "esc" key> (it's also important to remap caps lock to control, on the mac its easy: System Preferences->Keyboard->Keyboard->Modifier Keys)

Note: that isn't exactly the same--using Esc will trigger InsertLeave autocommands, Ctrl-C will not.

Re: Vim: revisited

#37
post #25

Why people always emphasis h/j/k/l when we already have arrow keys? Do you really waste a lot of time moving your fingers between them? Also, arrow keys work in insert mode.

If you touch-type, keeping fingers on the home row is essential. So, yes, it's a huge waste.

+1 But I remapped the movement keys to j/k/l/; to avoid moving my left-index finger.

Re: Vim: revisited

#38
>I learned this the hard way: you shouldn’t start with a huge .vimrc file that you copied from someone else nor should you install every single plugin that seems useful at that moment.

This is probably the most valuable piece of advice in the article. I have over a number of years looked at the tangled mess that my .vimrc had become, but always put off cleaning it up because I really didn't understand what some of the things did.

I thought to myself: Yes some of the keys act a little funny (sophacles/vim-bundle-python had awful, conflicting use of [c when I used Vimdiff on a python file), and yes I get warnings about some things, but hey, I must have put all this stuff in the config file for some reason.

Well, tonight I finally pitched my whole .vimrc (https://gist.github.com/1464673) and I am much happier as a result. I realized that I didn't need all that stuff to be productive, and I never probably used any of it anyway.

Re: Vim: revisited

#39
post #29

Why people always emphasis h/j/k/l when we already have arrow keys? Do you really waste a lot of time moving your fingers between them? Also, arrow keys work in insert mode.

This is a perfect place to post a Vim tip that I think helped me the most in starting out. Disable arrow keys. It's extremely painful for the first 5 days but I promise that's all it takes to get use to it. And it makes huge difference in your productivity. All that time does add up. Add the following to your .vimrc map map map map imap imap imap imap The reason you want arrow keys disabled in insert mode is that arr…

I learned vim's movement keys by playing nethack on a laptop without a number pad. This is a very fun way to learn hjkl. It also punishes you quickly if you make a mistake.

Re: Vim: revisited

#40
critical: Map Caps Lock to control and use control-[ instead of escape.

It's very easy to do on most OS's today and not having to move your hand from the home row when you switch into command mode is as big as proper use of jump commands imo.

I also agree to avoid all massive .vimrc files. If you don't understand it, don't use it. Simple.

Post reply on HN