set nocompatible set bs=2 set ai set backup set vb t_vb= set noeb set nowrap set ignorecase smartcase set tabstop=8 shiftwidth=4 expandtab softtabstop=4 set history=50 set nomodeline set hidden let g:cvimsyn='$VIMRUNTIME/CVIMSYN' set incsearch set hls set ruler set viminfo='100,\"50,rA:,rB:,rF:,rG: source $VIMRUNTIME/macros/matchit.vim filetype plugin on set popt=header:0 colorscheme default " show matching brackets set showmatch set matchtime=5 map Q gq map :cprevious map :cnext map :make map :close let Tlist_Ctags_Cmd="exuberant-ctags" let spell_executable = "aspell" let spell_auto_type = "" "let spell_language_list="en_GB" " browse in directory of current buffer set browsedir=buffer " set current directory to that of current buffer " set autochdir only works in gvim " makes the spell-checker work with mutliple files loaded autocmd BufEnter * \ try | \ if bufname("") !~ "^\[A-Za-z0-9\]*://" | \ sil! lcd %:p:h | \ endif | \ catch | \ endtry " Cscope settings set cscopequickfix=s-,c-,d-,i-,t-,e- " swap lines nmap gl ddpk " swap words nmap gw "_yiw:s/\(\%#\w\+\)\(\W\+\)\(\w\+\)/\3\2\1/ " swap characters nmap gc xph " keeps search line in centre of window nmap n nzz nmap N Nzz nmap * *zz nmap # #zz nmap g* g*zz nmap g# g#zz " settings for the minibufexplorer plugin let g:miniBufExplUseSingleClick = 1 let g:miniBufExplTabWrap = 1 let g:miniBufExplMapCTabSwitchBufs = 1 " Protect large files from sourcing and other overhead. " Files become read only if !exists("large_file_auto_commands_loaded") let large_file_auto_commands_loaded = 1 " Large files are > 10M " Set options: " eventignore+=FileType (no syntax highlighting etc " assumes FileType always on) " noswapfile (save copy of file) " bufhidden=unload (save memory when other file is viewed) " buftype=nowritefile (is read-only) " undolevels=-1 (no undo possible) let g:LargeFile = 1024 * 1024 * 10 augroup LargeFile autocmd BufReadPre * \ try | \ let f=expand("") | \ if getfsize(f) > g:LargeFile | \ set eventignore+=FileType | \ setlocal noswapfile bufhidden=unload buftype=nowrite undolevels=-1 | \ else | \ set eventignore-=FileType | \ endif | \ catch | \ endtry augroup END endif " Restore cursor to last position in previously edited file augroup JumpCursorOnEdit au! autocmd BufReadPost * \ if expand(":p:h") !=? $TEMP | \ if line("'\"") > 1 && line("'\"") <= line("$") | \ let JumpCursorOnEdit_foo = line("'\"") | \ let b:doopenfold = 1 | \ if (foldlevel(JumpCursorOnEdit_foo) > foldlevel(JumpCursorOnEdit_foo - 1)) | \ let JumpCursorOnEdit_foo = JumpCursorOnEdit_foo - 1 | \ let b:doopenfold = 2 | \ endif | \ exe JumpCursorOnEdit_foo | \ endif | \ endif " Need to postpone using "zv" until after reading the modelines. autocmd BufWinEnter * \ if exists("b:doopenfold") | \ exe "normal zv" | \ if(b:doopenfold > 1) | \ exe "+".1 | \ endif | \ unlet b:doopenfold | \ endif augroup END set backspace=indent,eol,start whichwrap+=<,>,[,]