vim 設定快捷鍵為 [Ctrl] + [s] 存檔

設定 [Ctrl] + [s] 快捷鍵為存檔

Step

1. 編輯 vim ~/.bashrc 加入

stty stop undef

 

2. 編輯 vim ~/.vimrc 加入以下

noremap <silent> <C-S>          :update<CR>

vnoremap <silent> <C-S>         <C-C>:update<CR>

inoremap <silent> <C-S>         <C-O>:update<CR>

 

3. 完成,重新執行 vim 就可以使用 [Ctrl] + [s] 存檔 = :w

 

如果想更徹底換成 Windows 常用組合鍵,可參考這篇這篇這篇(gvim)

 

參考網址:

1. http://brownydev.blogspot.tw/2014/01/vim-map-ctrls-to-save-file.html

2. http://haoxiang.org/2011/09/vim-modes-and-mappin/

posted @ 2014-03-24 22:45  a-jay  阅读(585)  评论(0编辑  收藏  举报