mandag 19. september 2011

VIM hacks: code completion


Code completion is one of the features I use the most in vim, and makes the task of writing a for-loop as easy as writing "for" and hitting <Tab>. it writes out html-tags for me and writes the main method automatically. 
This is not built-in, so you have to fetch the snipMate-plugin from vim.org here: http://www.vim.org/scripts/script.php?script_id=2540.

Installation:
  1. Unzip it into your /home/$USER/.vim/ -directory
  2. Open your /home/$USER/.vimrc-file and add ":filetype plugin on" on a separate line.
Now, depending on what your files end with, you get completion for a lot of tags and snippets! Try creating a .html-file and write "html" and press<Tab>, or even better - "head" and <Tab>.


Ingen kommentarer:

Legg inn en kommentar