ソースを参照

Minor update to functions in vimrc

Add <S-w> to hide a buffers
Use command! in case I want to reload my vimrc
Update all function definitions to conform use "function!"
Andrew Swistak 11 年 前
コミット
60674c7173
1 ファイル変更6 行追加8 行削除
  1. 6 8
      vimrc

+ 6 - 8
vimrc

@@ -70,12 +70,8 @@ nnoremap k gk
 
 " Set CTRL+S to save becuase I smack that every 10 seconds on whatever application I use
 " browse is only available in gvim
-command -nargs=0 -bar Save if &modified
-          \|  if empty(bufname('%'))
-          \|    browse confirm write
-          \|  else
-          \|    confirm write
-          \|  endif
+command! -nargs=0 -bar Save if &modified
+          \|  confirm write
           \|endif
 nnoremap <silent> <C-s> :Save<CR>
 inoremap <C-s> <C-o>:Save<CR>
@@ -84,6 +80,8 @@ vnoremap <C-s> <C-o>:Save<CR>
 " CTRL+w to close the current buffer
 nnoremap <silent> <C-w> :call CloseWindow()<CR>
 
+nnoremap <silent> <S-w> :hide<CR>
+
 " Buffer magic
 nnoremap <leader>l :ls<CR>:b<space>
 nnoremap <leader>b :ls<CR>:bd<space>
@@ -287,7 +285,7 @@ colors Monokai
 """"""""""""""""""""""""""""""""""""""""
 
 " Delete trailing whitespaces on saving.
-func! DeleteTrailingWS()
+function! DeleteTrailingWS()
   exe "normal mz"
   %s/\s\+$//ge
   exe "normal `z"
@@ -303,7 +301,7 @@ while c <= 'z'
 endw
 
 " Close current window or vim if no unsaved windows are open.
-fun! CloseWindow()
+function! CloseWindow()
   if &modified
     echo "Save first or manual exit."
   else