如何在vim中删除下一个字符(不是当前的!)? [英] How to delete next character (not current!) in vim?

查看:20
本文介绍了如何在vim中删除下一个字符(不是当前的!)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我经常发现自己需要删除光标后的字符,而不是当前字符.在 vim 的正常模式下执行此操作的最短方法是什么?

I often find myself needing to delete the character after the cursor, but not the current character. What's the shortest way to do this in normal mode in vim?

推荐答案

lx 可以解决问题,或者 lxh 如果您想将光标返回到原始位置.

lx will do the trick, or lxh if you want to return your cursor to the original position.

它只是向前移动光标并删除它下面的字符.

It simply moves the cursor forward and deletes the character under it.

如果这还不够短,您可以将其映射到单个按键:

If that's not short enough, you can map it to a single keypress:

:map <f5> lxh

然后只需使用 f5 功能键.

Then just use the f5 function key.

这篇关于如何在vim中删除下一个字符(不是当前的!)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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