stop indentation on current file in vim to keep the indentation from copied text.

2009-10-22 1 min read Linux Vim Tips

I have been looking for this for quite some time. Finally found two easy ways to do it:

:setlocal noautoindent
:setlocal nocindent
:setlocal nosmartindent
:setlocal indentexpr=

Just use the above four commands when the file is already open to stop all the indentation/smart indentation/auto indentation in vim for the current file. If you want to map it then you can use shorthand notations and map it in the .vimrc file.

Continue reading

<dot>vimrc file for vim users

2009-10-01 7 min read Linux Vim Tips

Example vimrc file below:

let g:VIM_CUSTOM = &#8221;/home/amitag/.vim_custom/&#8221;

&#8221; Don&#8217;t use vi compatibility; I want all the new features in Vim

set nocompatible

&#8221; Version 6.0-specific stuff

if version >= 600

syntax enable

filetype on

filetype plugin on

filetype indent on

else

syntax on

endif

set showfulltag &#8221; Get function usage help automatically

set showcmd &#8221; Show current vim command in status bar

set showmatch &#8221; Show matching parentheses/brackets

set showmode &#8221; Show current vim mode

Continue reading
Newer posts