本文介绍了在VIM中删除光标之后或周围的单词的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我现在从TextMate切换到VIM
.我发现INSERT模式下的^+W
非常有用.但是,我不仅要删除光标之前的单词,还要删除光标之后或周围的单词.
I'm now switching to VIM
from TextMate. I found ^+W
in INSERT mode very useful. However, I'd like to delete not only the word before cursor, but the word after or around cursor as well.
我做了一些谷歌搜索,但是我唯一能找到的是^+W
在光标之前删除单词.
I did some googling, but the only thing I can find was ^+W
to delete word BEFORE cursor.
推荐答案
您应该做的是为一系列命令创建一个具有特定键的imap,在这种情况下,这些命令将使您进入正常模式,删除当前字,然后将您重新插入:
What you should do is create an imap of a certain key to a series of commands, in this case the commands will drop you into normal mode, delete the current word and then put you back in insert:
:imap <C-d> <C-[>diwi
这篇关于在VIM中删除光标之后或周围的单词的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!