问题
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