Skip to content

Commit

Permalink
优化了强制写入的命令
Browse files Browse the repository at this point in the history
参照 [#138](wklken/k-vim#138) 的建议,将 w!! 从 keymap 改成了 command,现在输入W或Wq即可强制保存(退出)
  • Loading branch information
the-eric-kwok authored Dec 4, 2018
1 parent 1553860 commit 61c6f7d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ filetype on
filetype plugin on
filetype indent on

" save
command W :execute ':silent w !sudo tee % > /dev/null' | :edit! " sudo save and reload
command Wq :execute ':silent w !sudo tee % > /dev/null' | :edit! |:quit " sudo save and exit

" base
set nocompatible " don't bother with vi compatibility
Expand Down Expand Up @@ -246,9 +249,6 @@ nnoremap ; :
nnoremap H ^
nnoremap L $
" save
cmap w!! w !sudo tee >/dev/null %
" command mode, ctrl-a to head, ctrl-e to tail
cnoremap <C-j> <t_kd>
cnoremap <C-k> <t_ku>
Expand Down

0 comments on commit 61c6f7d

Please sign in to comment.