aboutsummaryrefslogtreecommitdiff
path: root/vim/vimrc
diff options
context:
space:
mode:
Diffstat (limited to 'vim/vimrc')
-rw-r--r--vim/vimrc29
1 files changed, 14 insertions, 15 deletions
diff --git a/vim/vimrc b/vim/vimrc
index aede100c..e93bd4e3 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -14,22 +14,21 @@ set shiftwidth=4 " Indent with four spaces
" Make insert mode tab key add the same number of spaces as 'shiftwidth', use
" negative value to do this if Vim new enough to support it
-let &softtabstop =
- \ v:version > 703 || v:version == 703 && has('patch693')
- \ ? -1
- \ : &shiftwidth
+let &softtabstop = v:version > 703
+ \ || v:version == 703 && has('patch693')
+ \ ? -1 : &shiftwidth
" Restore insert mode 'backspace' limits to the stringent Vim default, if a
" system vimrc or Neovim has messed with it
set backspace=
-" Keep backup files in dedicated directory
+" Keep backup files in dedicated directory; add trailing double-slash to keep
+" full path in name, if Vim is new enough to support that
set backup
-if has('patch-8.1.251') " Can keep full path in filename
- set backupdir^=$MYVIM/cache/backup//
-else
- set backupdir^=$MYVIM/cache/backup
-endif
+execute 'set backupdir^='
+ \ . escape($MYVIM, '\ ')
+ \ . '/cache/backup'
+ \ . (has('patch-8.1.251') ? '//' : '')
" Add some *nix paths not to back up
if has('unix')
@@ -182,7 +181,7 @@ endif
" getting clobbered when something runs Vim without using this vimrc
let $VIMINFO = $MYVIM.'/viminfo'
if exists('+viminfofile') " Use new option method if we can (v8.1.716)
- let &viminfofile = $VIMINFO
+ set viminfofile=$VIMINFO
else " Resort to clunkier method with 'viminfo' option flag
execute 'set viminfo+=n'.escape($VIMINFO, '\ ')
endif
@@ -238,11 +237,11 @@ catch
set background=dark
endtry
-" Remap normal space to scroll down a page
-nnoremap <Space> <PageDown>
-" Do a :next after hitting the last line
-if &loadplugins " Don't change the mapping if we won't be loading the plugin
+" Space bar scrolls down a page, :next if plugin available
+if &loadplugins
nmap <Space> <Plug>(ScrollNext)
+else
+ nnoremap <Space> <PageDown>
endif
" Remap insert Ctrl-C to undo the escaped insert operation