set nocompatible source $VIMRUNTIME/vimrc_example.vim source $VIMRUNTIME/mswin.vim behave mswin syntax enable " Set the following to an appropriate directory on your OS " set directory=C:\Users\USERNAME\Documents set history=1000 set number set ai shiftwidth=4 set smartindent set expandtab set cindent set paste set ignorecase " Ignore case in search, see smartcase set smartcase " Override 'ignorecase' when pattern has upper case characters set incsearch " Search while you are typing " , show match braces as you type set showmatch set matchtime=3 set backspace=indent,start " , show status bar constantly set laststatus=2 " , show the ruler bar constantly set ruler set showmode set showcmd " , #perl # comments map ,# :s/^/#/ " ,/ C/C++/C#/Java // comments map ,/ :s/^/\/\// " ,< HTML comment map ,< :s/^\(.*\)$//:nohlsearch " c++ java style comments map ,* :s/^\(.*\)$/\/\* \1 \*\//:nohlsearch " ,cc clear the comments map ,cc :s/^\/\/\\|^--\\|^> \\|^[#"%!;]//:nohlsearch " for HTML, generally format text, but if a long line has been created leave it " alone when editing: autocmd FileType html set formatoptions+=tl " for both CSS and HTML, use genuine tab characters for indentation, to make " files a few bytes smaller: autocmd FileType html,css set noexpandtab tabstop=2 set diffexpr=MyDiff() function MyDiff() let opt = '-a --binary ' if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif let arg1 = v:fname_in if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif let arg2 = v:fname_new if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif let arg3 = v:fname_out if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif let eq = '' if $VIMRUNTIME =~ ' ' if &sh =~ '\ ' . arg3 . eq endfunction