My all-time favourite commands for vim. Check out these classic hits.

Formatting

Format/indent/pretty-print an XML document:

:%!xmllint --format %

Insert spaces instead of tabs (expandtab) when pressing the Tab key - how to switch on and off:

:set et
:set noet

Personalisation

How I set up my Vim ready to use:

  1. Install Vundle for managing Vim plugins

To install/manage plugins with Vundle:

  1. Add any plugins required into /.vimrc
  2. From Vim, type :PluginInstall.

To configure syntax highlighting for a file type/extension, add the following to your ~/.vimrc file:

au BufRead,BufNewFile *.adoc set filetype=asciidoc

Using Vim as a Java IDE

Install SpaceVim.

SpaceVim

Keys: