alt + backspace删除vim中的单词 [英] alt+backspace to delete words in vim

查看:71
本文介绍了alt + backspace删除vim中的单词的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何重新映射 alt + backspace 以删除诸如本机* NIX文本操作之类的单词?我签出了以下线程:使用alt +退格键在vim命令行中键入要删除的文字

How can I remap alt+backspace to delete words like native *NIX text manipulation? I checked out this thread: Using alt+backspace key in vim command line to delete by words

和类似的示例: cmap< a-bs>< c-w> :imap< A-BS>< C-W> 不做任何事情.公认的答案实际上是什至不重新映射它,而是使用 ctrl + w .由于VIM的 alt + backspace 不做任何事情,所以我希望将其重新映射到我惯用的东西.

And the examples like: cmap <a-bs> <c-w> and :imap <A-BS> <C-W> don't do anything. And the accepted answer was actually to not even remap it, but to use ctrl+w. Since VIM's alt+backspace doesn't do anything I'd rather remap it to something I'm used to.

我正在使用基于终端的VIM(特别是在iTerm中)

I'm using terminal based VIM (specifically in iTerm)

推荐答案

Alt/Meta键在Vim和大多数终端中都是有问题的,请参见我的答案以了解情况的概述( Meta Alt 的情况相同).

The Alt/Meta key is problematic in Vim and most terminals, see this answer of mine for an overview of the situation (the situation is the same for Meta and Alt).

简而言之,Vim根本不接收 Alt :击 Alt + Backspace 与击 Backspace 完全一样.

In short, Vim doesn't receive Alt at all: hitting Alt+Backspace is exactly the same as hitting Backspace.

无论如何,从长远来看,对您来说学习和习惯Vim的默认键映射会更好.

Anyway, it will be better for you in the long term to learn and get accustomed to Vim's default key-mappings.

这篇关于alt + backspace删除vim中的单词的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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