linux
VIM toggle indent
This is a short function to include in the .vimrc that will allow indenting to be toggled on and off.
toggle tab completion
function! ToggleIndent()
if g:indent_on == 1
:set nocindent noai
let g:indent_on = 0
echo "autoindent off"
else
:set cindent ai
let g:indent_on = 1
echo "autoindent on"
endif
endfunction
let g:indent_on = 1
The function could easily be re-written to toggle most anything on and off in vim.
Last Updated: 2009-02-07 20:40:50