Quickly start using Vim (and MacVim)

You've decided learning vi/vim is a good idea. You've heard it can be intimidating at first. But you know often times tools with steep learning curves are worth learning. You probably already have vim installed but if you're on Mac you should get MacVim as well: https://github.com/macvim-dev/macvim

Start vim (I mean just type 'vim' or 'vim <filename>' in a terminal. 

1. Don't start typing yet. Press 'i' to go into insert mode where you can just type and text appears like any normal text editor. Just stay in this mode until you are ready to move on. Press 'escape' to get out of insert mode, and you can type magical incantations or type ':' to run ex commands like ':wq!' to save and exit.

Don't worry about hjkl keys for moving around yet because you can just use the normal arrow keys or even the mouse/trackpad in vim.

In graphical MacVim, you can save files and close tabs like you would with any editor. You can also use the mouse to select text and the normal key combos to copy/paste (command-c, command-v).

If you want to use MacVim instead of vim on the terminal (OSX only) open the file like so: open -a macvim <filename>

Now take a look at a vi cheatsheet and slowly add to your vi vocabulary. Don't get frustrated if you find yourself in the wrong mode - look for '-- INSERT --' (insert mode) or ':" (ex or command mode) or nothing (normal mode) in the bottom line.

Have a look at this Vi cheat sheet embedded below: http://vim.rtorr.com

Once you know a bit, you can play around in VIM Adventures: http://vim-adventures.com (honestly, I did try it and wasn't very good so just play for fun)

Quickly start using Vim (and MacVim) | TECH.SAIGONIST.COM

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /home/tomo/web/tech.saigonist.com/drupal7/php/includes/common.inc:2776) in drupal_send_headers() (line 1486 of /home/tomo/web/tech.saigonist.com/drupal7/php/includes/bootstrap.inc).
  • Error: Class 'CToolsCssCache' not found in _cache_get_object() (line 32 of /home/tomo/web/tech.saigonist.com/drupal7/php/includes/cache.inc).
The website encountered an unexpected error. Please try again later.