Saturday, October 23, 2010

vim indentation

Some useful lines for configuring the indentation behavior of vim.
These commands can be executed inside vim, all preceded by a colon (:), or added to ~/.vimrc.

This changes the display width of the tab (to save precious screen space):
  set shiftwidth=3
  set tabstop=3

and adding this, replaces the tabs with spaces
  set softtabstop=3

To indent (or re-indent) a block of code, first select some lines with Shift-V, and then press =


No comments:

Post a Comment