开发者

mapping shortcut in vim without hanging the cursor

I would like to have vim fill a short sequence of characters into a longer string in insert mode. Example, say I write the word "sub" and it writes "subroutine" as soon as I press space. The problem I find is that when I use :imap sub subr开发者_StackOverflowoutine, every time I start typing sub, the cursor does not continue moving, but hangs in the same position waiting for more keystrokes in order to decide what to do. I find this behavior annoying, although not wrong (it does what I need).

Is there a way to have vim continue typing single characters, and eventually replace ?


Just try to use abbreviate :ab sub subroutine


Search the web for "vim completion" (or the help for "completion"). The feature is in v7.x, but you may want to change the keystrokes with ìmap.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜