在Vim中,如何删除单词的后缀? [英] In Vim, how to delete the suffix of a word?

查看:161
本文介绍了在Vim中,如何删除单词的后缀?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在vim中,在正常模式下,如果光标位于单词中,而不是最后一个字母中,则de从光标位置删除单词的后缀.如果光标位于最后一个字母上,那么x也会这样做,而de会跳到下一个单词的末尾.

In vim, in normal mode, if the cursor is in a word, not the last letter, de deletes the suffix of the word, from the position of the cursor. If the cursor is on the last letter, x does it too, while de would jump to the end of the next word.

您将使用哪种命令在两种情况下都有效(无论是否使用最后一个字母)?

What command would you use that would work in both cases, last letter or not?

目的是将命令包含在宏中.

The purpose is to include the command in a macro.

推荐答案

尝试使用vwged而不是de,并定义如下所示的映射(如果您 喜欢它.

Try vwged instead of de, and define a mapping like the following, if you like it.

:nnoremap <leader>de vwged

它似乎完全可以满足您的要求.

It seems to do exactly what you want.

这篇关于在Vim中,如何删除单词的后缀?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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