有没有办法将Control + 6或Shift + Control + ^映射到引导键? [英] Is there a way to map Control + 6 or Shift + Control + ^ to a leader key?

查看:146
本文介绍了有没有办法将Control + 6或Shift + Control + ^映射到引导键?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Control + 6Shift + Control + ^将在vim中的当前文件和备用文件之间切换.它很有用,但我讨厌使用Control键,并尽可能避免使用它.但是,尽管进行了搜索和试验,但我似乎无法映射到我的领导者钥匙.我认为问题出在数字键和插入符号.有人有任何想法要让这个工作吗?

Control + 6 or Shift + Control + ^ will switch between the current file and the alternate file in vim. Its useful but I hate using the Control key and try to avoid it if possible. However, despite searching and experimenting I can't seem to map to my leader key. I think the problem is with numeric keys and the caret. Anybody have any ideas to get this working?

预先感谢

推荐答案

这两项都是

nnoremap <leader>f <C-^>
nnoremap <leader>v :e #<CR>

由于我不确定您想要哪个字母,因此它们当前被映射为前面带有领导者的随机字母.根据 :h CTRL-^ ,第二个功能是与<C-^>等效的行为一个>.除非它不适用于没有名称的文件.

They are currently mapped to random letters with leader in front as I wasn't sure which ones you wanted. The second one is the functionally equivalent behavior to <C-^> according to :h CTRL-^. Except that it doesn't work with files with no names.

没有看到您尝试过的内容,我无法告诉您出了什么问题.

Without seeing what you tried I cannot tell you what went wrong.

这篇关于有没有办法将Control + 6或Shift + Control + ^映射到引导键?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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