Is there a way to map Control + 6 or Shift + Control + ^ to a leader key?

扶醉桌前 提交于 2019-12-13 15:56:36

问题


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?

Thanks in advance


回答1:


Both of these work.

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

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.



来源:https://stackoverflow.com/questions/17076245/is-there-a-way-to-map-control-6-or-shift-control-to-a-leader-key

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!