Thursday, September 27, 2012

Re: why is it so difficult to start using vim (may be just for me).

Vim is easy to use, but not easy to learn.   

The trick for me, beyond the basics which I had known for eons, was to create my own cheat sheets. I use tomboy notes.  I think it much less useful to download a cheat sheet.  Making  your own will start you on your way to remembering.  I keep several, but do what makes sense for you:
  • vim command line options, plugins
  • folding, movement, editing
  • searching, regex, other
  • sessions, windows, buffers, tabs
One does not really learn vim.  Instead one trains one's finger to 'know', i.e. it is all muscle memory.  I have been asked how to do something and found I was not been able to reply with the answer until I put my fingers on the keyboard.

As my fingers learn the commands, I remove commands from my cheat sheet and add new ones.  Go slow.  Train your fingers with commands before adding too many.  Six mo. ago, I added some of the folding commands.  I was writing more in python and my old ways of navigating did not work with python's scoping.    Now I LOVE syntax folding.

But start with the tutor as other have said.  I didn't do this for cheat sheets, but it might help you write your first ones.

** After the tutor, learn the structure of commands. This is excellent: http://blog.carbonfive.com/2011/10/17/vim-text-objects-the-definitive-guide/

My latest command added?  
  • :r !<cmd> // Saw this one on this list. Thanks list!
    • This runs the command and writes its output in your buffer.   Very handy to get a svn diff into a window next to the file just diffed.
-d
--   David Ohlemacher  Principle Software Engineer  Scientific Solutions Inc.   99 Perimeter Rd Nashua New Hampshire 03063  603-880-3784    . o .  . . o  o o o  

No comments:

Post a Comment