diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2012-07-18 12:27:25 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2012-07-18 12:27:25 +1200 |
commit | 7181fb7618d7ab86b98e1d23aab4a910d4734fe0 (patch) | |
tree | 855f5caca6a604082beb00c3816c1cf1fcff5e1d /vim | |
parent | Ignore spelling files (diff) | |
download | dotfiles-7181fb7618d7ab86b98e1d23aab4a910d4734fe0.tar.gz dotfiles-7181fb7618d7ab86b98e1d23aab4a910d4734fe0.zip |
Don't do funcs or vars when no +eval
This stops my .vimrc throwing errors at me when I happen to run it on
a machine that only has vim-tiny, which tends to exclude the +eval
feature necessary for function and variable declarations
Diffstat (limited to 'vim')
-rw-r--r-- | vim/vimrc | 24 |
1 files changed, 14 insertions, 10 deletions
@@ -85,14 +85,16 @@ set shiftwidth=4 set softtabstop=4 set tabstop=4 nnoremap J mzJ`z -function! ToggleFormatFlag(flag) - let l:operation = (&formatoptions =~ a:flag) ? '-=' : '+=' - silent! exec 'setlocal formatoptions' l:operation . a:flag - setlocal formatoptions? -endfunction -nnoremap <silent> <leader>a :<C-U>call ToggleFormatFlag('a')<CR> -nnoremap <silent> <leader>c :<C-U>call ToggleFormatFlag('c')<CR> -nnoremap <silent> <leader>t :<C-U>call ToggleFormatFlag('t')<CR> +if has("eval") + function! ToggleFormatFlag(flag) + let l:operation = (&formatoptions =~ a:flag) ? '-=' : '+=' + silent! exec 'setlocal formatoptions' l:operation . a:flag + setlocal formatoptions? + endfunction + nnoremap <silent> <leader>a :<C-U>call ToggleFormatFlag('a')<CR> + nnoremap <silent> <leader>c :<C-U>call ToggleFormatFlag('c')<CR> + nnoremap <silent> <leader>t :<C-U>call ToggleFormatFlag('t')<CR> +endif " History set history=1000 @@ -105,8 +107,10 @@ nnoremap <leader>l :setlocal list!<CR> silent! runtime macros/matchit.vim " Netrw -let g:netrw_silent = 1 -let g:netrw_liststyle = 3 +if has("eval") + let g:netrw_silent = 1 + let g:netrw_liststyle = 3 +endif " Messages set shortmess+=I |