Entry 3520
vimrc
Submitted by anonymous
on April 6, 2010 at 11 p.m.
Language: VimL. Code size: 4.0 KB.
"break vi compatibility set nocompatible "make backspace delete set bs=2 "set preferred syntax coloring colo blugrine "max number of tabs allowed set tabpagemax=20 "set directory for swap files set dir=~/.tmp "ShowMarks settings "marks to include let showmarks_include = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.'`^<>[]{}()\"" "ennable plugin let g:showmarks_enable = 1 "set white on black text for marks highlight ShowMarksHLl ctermfg=white ctermbg=black cterm=bold highlight ShowMarksHLu ctermfg=white ctermbg=black cterm=bold highlight ShowMarksHLo ctermfg=white ctermbg=black cterm=bold highlight ShowMarksHLm ctermfg=white ctermbg=black cterm=bold "enable syntax coloring syntax enable "set numbered lines set nu "indent automatically set autoindent "indent correctly set smartindent "handle tabs correctly set smarttab "tabs are every 4 spaces set tabstop=4 "indent is 4 spaces wide set shiftwidth=4 "expand tabs to spaces set expandtab "handle 4 spaces as a tab, "ie backspace will delete 4 spaces at a time set softtabstop=4 "menu for tab completion set wildmenu "ignore files set wildignore=.svn,.git,CVS,*.swp,*.class,*.o "incremental search as you type set incsearch "set highlight for search set hlsearch "Display incomplete commands set showcmd "enable mouse set mouse=a "set selection clipboard to vim default register " copy works in console set clipboard=unnamed "set copy clipboard to vim default register " copy works in console "set clipboard+=unnamed "set font set gfn=DejavuSansMono\ 14 "set fold levels to indent levels "set fdm=indent "spell on off function let spSet = 0 function SpToggle() if g:spSet == 0 setlocal spell spelllang=en_us let g:spSet = 1 else setlocal nospell let g:spSet = 0 endif endfunction "map function keys to action "previous tab map <F1> <Esc>:tabp<CR> imap <F1> <Esc>:tabp<CR> "next tab map <F2> <Esc>:tabn<CR> imap <F2> <Esc>:tabn<CR> "next window map <F3> <Esc>:winc w<CR> imap <F3> <Esc>:winc w<CR> "new window map <F4> <Esc>:vs<CR> imap <F4> <Esc>:vs<CR> "fold less map <F5> <Esc>zr imap <F5> <Esc>zri "fold more map <F6> <Esc>zm imap <F6> <Esc>zmi "fold none map <F7> <Esc>zR imap <F7> <Esc>zRi "fold all map <F8> <Esc>zM imap <F8> <Esc>zMi "turn on spellcheck map <F9> <Esc>:call SpToggle()<CR> imap <F9> <Esc>:call SpToggle()<CR>i "fix previous spellcheck error map <F10> <Esc>[sz= imap <F10> <Esc>[sz= "fix next spellcheck error map <S-F10> <Esc>]sz= imap <S-F10> <Esc>]sz= "alias Esc key as Shift-Tab imap <S-Tab> <Esc> map! <S-Tab> <Esc> vmap <S-Tab> <Esc> "caps while trying to save or quit will be interpreted correctly map :W :w map :WQ :wq map :Wq :wq map :wQ :wq map :Q :q "highlight bad whitespace highlight BadWhitespace term=standout ctermbg=red guibg=red match BadWhitespace /\s\+$\|[^* \t]\zs\s\+$\| \+\ze\t/ "match pairs: match angle brackets (less than/greater than) set matchpairs+=<:> highlight matchParen ctermbg=black ctermfg=white "default build tool ":make calls system's make set makeprg=make "parse gcc output set efm=%f:%l:%m,%f:kk%l:\ %m,In\ file\ included\ from\ %f:%l:,\^I\^Ifrom\ %f:%l%m "called for C/C++ files function SetMakeC() ":make calls system's make setlocal makeprg=make "parse gcc output setlocal efm=%f:%l:%m,%f:kk%l:\ %m,In\ file\ included\ from\ %f:%l:,\^I\^Ifrom\ %f:%l%m endfunction "called for java files function SetMakeJava() ":make calls ant setlocal makeprg=ant "parse javac or rapc output from ant setlocal efm=%A\ %#[javac]\ %f:%l:\ %m,%-Z\ %#[javac]\ %p^,%-C%.%#,%A\ %#[rapc]\ %f:%l:\ %m,%-Z\ %#[rapc]\ %p^,%-C%.%# endfunction "called for make files function SetMakeFile() "setup for C/C++ call SetMakeC() "set filetype to make setf make endfunction "set filetype to makefile when for files named 'makefile' au BufRead,BufNewFile makefile call SetMakeFile() "call setup function for c/c++ au BufRead,BufNewFile *.c,*.cpp,*.h,*.C,*.CPP,*.cxx call SetMakeC() "call setup function for java au BufRead,BufNewFile *.java call SetMakeJava()
This snippet took 0.02 seconds to highlight.
Back to the Entry List or Home.