後的光標位置我試圖用一個簡單的函數來呼應XML標籤:VIM函數生成一個標記,如何中心輸出
func! SayTag()
let tagName = input("Tag: ")
return "<" . tagName . ">" . "<" . tagName . ">"
endfunc
並綁定到:
imap \tag <C-R>=SayTag()<CR>
但輸出後,光標位於標籤之後,例如:<TAG> </TAG> _CURSOR_
如何動態設置光標位置?
哦不錯的實現:) – lucapette