vim - Vim Ctrl-] 不起作用,那么我该如何重新映射它的功能呢?(视窗 10)
问题描述
今天我安装了一个最近的 64 位 Gvim:
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Dec 13 2020 23:02:22)
MS-Windows 64-bit GUI version with OLE support
Included patches: 1-2143
Compiled by appveyor@APPVYR-WIN
...
我曾经是一个 vimer,但很久以前就切换到 emacs 和 evil-mode。我正在调查我是否应该回到vim,所以......
奇怪的是,Ctrl-]
关键在 vim 中扮演死人。它不会跳转到光标下的标签,当我按下那个键时没有任何反应,根本没有反应。
跳转到带有的标签<C-LeftMouse>
确实有效。
物理密钥确实有效。当我向 Emacs 询问这个密钥时,它回答:
C-] runs the command abort-recursive-edit (found in global-map), which
is an interactive built-in function in ‘C source code’.
It is bound to <menu-bar> <minibuf> <quit>, C-], C-}.
(abort-recursive-edit)
Abort the command that requested this recursive edit or minibuffer input.
我还检查了使用key history tool
in an autohotkey script
: theCtrl
和 the]
都被正确跟踪。
为了验证我是否在尝试 vim 的短时间内创建的小脚本.vimrc
和脚本中引起了问题,我在没有初始化文件的情况下运行了 vim 和 gvim:.gvimrc
vim -u NONE -U NONE
gvim -u NONE -U NONE
同样的问题,钥匙不起作用。
昨天我不小心安装了最新的官方 32 位 windows 安装程序(我今天将其删除并替换为这个 64 位版本)。我确实在新安装的 gvim 的第一次运行时遇到了这个问题,但推迟了对它的研究,直到我的python 支持问题得到适当修复(感谢filbranden)。
所以它出现在 32 位和 64 位版本中,去看看......
但这真的很不幸,每当我想跳转到帮助标签之一时,我都不想抓住鼠标。
当然,我想了解并解决这个问题。但只要没有修复,我想将功能重新映射到另一个键,但我不知道该怎么做。
任何解决原始问题或重新映射标签跳转功能的帮助将不胜感激。
提前致谢, 圭多
解决方案
It should be easy enough to remap this particular combination like any other, to permanently set the binding add the following line to your vimrc:
nnoremap <C-]> :command-you-want<CR>
Typically, the command you are looking for is :ta
which can be mapped like so:
nnoremap <leader>t :ta<CR>
You should be able to map it to whatever your Left Click is doing as well. If you check in :help index
it should show you your current bindings. For me both C-LeftMouse
and C-]
are doing :ta
I suspect your C-]
isn't for some reason. You can try setting it to that manually as in the above example.
Personally I have a baked potato for a hippocampus and find I forget more advanced bindings all the time so i keep :help index
bound to F1.
推荐阅读
- javascript - 在 SelectDateWidget 中单独更改月、年和日期宽度
- reactjs - 使用 React 和 Pyramid(微服务架构)进行身份验证,如何存储“会话数据”?
- python - 斐波那契 N 个数的总和
- java - Spring security 适用于 GET 但不适用于其他方法
- apache-spark - 将sql函数重写为纯spark
- wordpress - WordPress 访问站点指向另一个 URL
- amazon-web-services - 如何将 Fargate 服务添加到入站安全规则?
- bash - bash for循环仅返回arra xlength的最后一个值x倍
- python - 丢失 UI 共享上下文后的 PermissionError
- azure - Azure B2C - Ap.Net WebForms(无 MVC) - AuthorizationCodeReceived