From c7398479c7b7c150d62553076404791288f863a6 Mon Sep 17 00:00:00 2001 From: Dustin Swan Date: Wed, 14 Dec 2011 17:40:57 -0500 Subject: [PATCH] Adding version depending stuff to vimrc for my old vim at work --- vimrc | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/vimrc b/vimrc index b900060..ac9ddf8 100644 --- a/vimrc +++ b/vimrc @@ -15,9 +15,11 @@ set history=1000 " turn off swapfiles set noswapfile -" persistent undo (>7.3) -set undodir=~/.vim/undodir -set undofile +" persistent undo +if v:version > 703 + set undodir=~/.vim/undodir + set undofile +endif " line numbers set nu @@ -27,7 +29,7 @@ set wildmenu set wildmode=longest:full " show the command as it is typed -" set sc +set sc " remap the leader to ,. hate doing this but \ is so far away let mapleader = "," @@ -54,7 +56,6 @@ set shiftwidth=4 set mat=2 set ruler -set nohls " so we get html goodies in php files au BufRead *.php set ft=php.html @@ -88,7 +89,9 @@ endif set statusline= set statusline+=%f\ %2*%m\ %1*%h set statusline+=%#warningmsg# -set statusline+=%{SyntasticStatuslineFlag()} +if v:version > 700 + set statusline+=%{SyntasticStatuslineFlag()} +endif set statusline+=%{fugitive#statusline()} set statusline+=%* set statusline+=%r%=[%{&encoding}\ %{&fileformat}\ %{strlen(&ft)?&ft:'none'}] @@ -96,8 +99,12 @@ set statusline+=%15.(%c:%l/%L%)\ %P set laststatus=2 " Syntastic -let g:syntastic_enable_signs=1 -let g:syntastic_auto_loc_list=1 +if v:version > 700 + let g:syntastic_enable_signs=1 + let g:syntastic_auto_loc_list=1 +else + let g:loaded_syntastic_plugin = 1 +endif " Highlight current line set cursorline @@ -107,15 +114,11 @@ if version > 702 set colorcolumn=80 endif -" quickly move between splits -" nnoremap h -" nnoremap l -" nnoremap j -" nnoremap k - " pretty line endings and trailing spaces set list listchars=tab:»·,trail:·,eol:↪ -" set list listchars=tab:»·,trail:·,eol:· -" fine I give up +" fine I'll try it inoremap jk +inoremap kj +" stop hitting Esc or c-[! +inoremap