比如有一個單詞dcustmsg我已經在v模式選中了該單詞,有沒有快捷鍵在這個單詞的兩側添加引號,使之變為"dcustmsg"
3 回答

拉風的咖菲貓
TA貢獻1995條經驗 獲得超2個贊
配置文件添加函數和鍵映射如下:
function! s:surround() let word = expand("<cword>") let wrap= input("wrap with: ") let command = "s/".word."/".wrap.word.wrap."/" execute commandendfunctionnmap cx :call <SID>surround()<CR>
這樣normal模式光標放在單詞上,然后使用快捷鍵cx,會提示兩邊填充的字符,輸入字符回車即可。
- 3 回答
- 0 關注
- 278 瀏覽
添加回答
舉報
0/150
提交
取消