[vim ] 如何強制固定key mapping
看板Editor (編輯器(vim/emacs))作者Holocaust123 (奔跑的蝸牛)時間14年前 (2011/04/10 16:25)推噓1(1推 0噓 3→)留言4則, 3人參與討論串1/1
.vimrc 中有很多我常用的 key mapping
其中有些 key mapping 在安裝 plugin 後會被 remap
請問有沒有什麼關鍵字(像 final 之類的)
可以強制固定 .vimrc 中的 key mapping
使得我習慣的 key mapping 不要被 plugin 的 key mapping 覆蓋掉?
我現在是直接去改 plugin script 的 source
不過這樣每次 plugin 更新就又要重改一次 實在麻煩 (我用的 plugin 還蠻多的)
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.112.30.46
→
04/11 18:02, , 1F
04/11 18:02, 1F
→
04/12 03:57, , 2F
04/12 03:57, 2F
推
04/12 08:47, , 3F
04/12 08:47, 3F
→
04/12 08:48, , 4F
04/12 08:48, 4F
感謝兩位P大的回答
不過我比較希望可以不需把 mapping 從 .vimrc 獨立出來
其中一個原因是
mapping只是(plugin或其他)設定的一部分而已
意思是我.vimrc有這樣的區塊:
" Settings for certain purposes
let g:some_setting_1=...
let g:some_setting_2=...
let g:some_setting_3=...
set some_option_1
set some_option_2=...
set no_some_option_3
command! ShowSomething :call ReturnSomething()
function! ReturnSomething()
....
endf
imap <leader>cn ....
map <F11> ....
若把mapping的部分從.vimrc抽出來放到 ~/.vim/after/keymap.vim 中
會讓這區塊的維護變得困難
當然也可以把整個區塊放到一個獨立的.vim中
但這樣若要檢查單一設定就只好一個一個.vim慢慢查了(或用vimgrep)
(不是說一個一個.vim有什麼不好
只是我比較偏好可以在單一檔案(.vimrc)總覽所有設定)
※ 編輯: Holocaust123 來自: 140.112.30.46 (04/12 14:01)
Editor 近期熱門文章
PTT數位生活區 即時熱門文章