" ------------------------------------- "Lev-s .vimrc file for Windows " ------------------------------------- syntax on " highlighting set nocompatible " Use Vim defaults (even on Windows) set ignorecase " ------------------------------------- " use taglist plugin and ctags: :map :TlistToggle :map :TlistToggle let Tlist_Exit_OnlyWindow = 1 " ------------------------------------- " use F3 to remove every 2nd newline :map :s/\(\n\)\n/\1/g " ------------------------------------- " use F5 to go between tabs :map :tabn :map :tabn " ------------------------------------- " use 2-space indentation set tabstop=2 set softtabstop=2 set shiftwidth=2 set expandtab " ------------------------------------- " always show status line - and show more info on it set laststatus=2 set statusline=%F%m%r%h%w\ %{&ff}\ %Y\ ascii=\%03.3b\ hex=\%02.2B\ [%04l,%04v](%p%%\ of\ %L) " ------------------------------------- "use F7 to toggle line numbers function! ToggleLineNumbers() if &number set nonumber else set number endif endfunction map :call ToggleLineNumbers() map :call ToggleLineNumbers() " ------------------------------------- function! TogglePerlComment() let s:line = getline('.') if s:line =~ "^#" :s/^#// else :s/^/#/ endif endfunction map :call TogglePerlComment() map :call TogglePerlComment() " ------------------------------------- function ToggleHLSearch() " toggle highlight after search if &hls set nohls else set hls endif endfunction nmap :call ToggleHLSearch(). " ------------------------------------- "To avoid invoking help when accidentally pressing F1, map it to Esc: map imap " ------------------------------------- "source $VIMRUNTIME/vimrc_example.vim " "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 " -------------------------------------