开发者

mapping shortcut in vim without hanging the cursor

开发者 https://www.devze.com 2023-02-04 01:32 出处:网络
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 probl

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

精彩评论

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

关注公众号