在 VIM 中删除光标后面或周围的单词 [英] delete word after or around cursor in VIM

查看:9
本文介绍了在 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 中删除光标后面或周围的单词的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆