let osys=system('uname -s') if osys =~ "SunOS" set term=xtermc elseif osys =~ "Linux" set term=xterm endif " Set the vimdir (I don't think this is needed, but I do it for kicks). let vimdir=$HOME . '/.vim/' " Make sure the .viminfo is placed in a good place. This is really done well " in the system wide config but I felt like making this. let &viminfo="'20," . '%,n' . vimdir . '/viminfo' " Make sure we use a sane value for the backupdir. let &backupdir=vimdir . '/tmp' " Files ignored on filename-completion. (For real ignore, use wildignore) set suffixes+=.class,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc " If we have more than two colors we use dark background and syntax " highlighting. if &t_Co > 2 || has("gui_running") set bg=dark syntax on endif " We do not want any toolbars or gui things. We like it stripped, the way " we're used to from the console. if has("gui_running") set guioptions=agiL colorscheme elflord endif " Make use of the filetype plugins and indentation support that came in vim " 6.0. filetype plugin indent on " Incremental search is nice. set incsearch " We want to use backup files. These are stored in the backupdir we defined " earlier. set backup set backspace=2 set bg=dark set errorbells set noexpandtab set hidden set history=100 set laststatus=2 set nowarn set nowrap set number set showmatch set smartcase set sts=4 set sw=4 set ts=8 " Set a satusline that gives some cool information. set statusline=%<%F%h%m%r%=\[%B\]\ %l,%c%V\ %P " We only want the statusline when we have more than one window. set laststatus=1 " Beep/flash on errors. set errorbells " We only want the flash. set visualbell " We want to play with wildmode (file-listing when opening a new file). set wildmode=list:longest " We use smartcase when searching. Remember that prepending the search " pattern with \c or \C overrides this. set smartcase " It's nice to see what paranthesis we just closed. set showmatch " This way we don't unload the buffers when we abandon them. We just hide " them. set hidden " If we have a saved position in the file, go there. autocmd BufReadPost * \ if line("'\"") > 0 && line("'\"") <= line("$") | \ exe "normal g`\"" | \ endif " latex-suite wants grep to always generate a file-name. set grepprg=grep\ -nH\ $* " Disable autoloading of vimspell due to it being buggy. let loaded_vimspell = 0 let spell_insert_mode = 0 let spell_auto_type = "tex,mail" let spell_language_list = "norsk,english" " Change directory to the directory of the file I'm working on. autocmd BufEnter * lcd %:p:h nnoremap ,i i?r nnoremap ,a a?r nnoremap :Tlist " Setup Taglist plugin let Tlist_Ctags_Cmd=$HOME . '/local/' . tolower(substitute(osys,"\n",'','')) . '/bin/ctags' " F1 for help is really annoying. nnoremap inoremap