简体   繁体   English

在vim的Explore窗口时,窗口导航映射<C-l>停止工作

[英]When in Explore window of vim, window navigation mapping <C-l> stops working

I use the following vimrc configuration to navigate between panes:我使用以下 vimrc 配置在窗格之间导航:

" easier window navigation
nnoremap <C-j> <C-W><C-J>
nnoremap <C-k> <C-W><C-K>
nnoremap <C-l> <C-W><C-L>
nnoremap <C-h> <C-W><C-H>

This works fine with the exception when I'm in a :Explore window to do some file exploration.当我在:Explore窗口中进行一些文件探索时,这可以正常工作。

All bindings besides <Cl> still work.除了<Cl>之外的所有绑定仍然有效。 But trying to navigate to the right with <Cl> stops working.但是尝试使用<Cl>向右导航会停止工作。 I than have to use <CW><Cl> to get out of the pane.我必须使用<CW><Cl>才能离开窗格。

What do I possible have to add or deactivate to make this work?我可能需要添加或停用什么才能使其正常工作?

As can be seen in :help netrw-browse-maps , the Netrw buffer has its own buffer-local mapping to <Cl> that overrides yours.:help netrw-browse-maps可以看出,Netrw 缓冲区有自己的缓冲区本地映射到<Cl>覆盖你的。

You can override Netrw's mapping with :help netrw-usermaps but it is at the cost of losing the ability to refresh the listing:您可以使用:help netrw-usermaps覆盖 Netrw 的映射,但代价是失去刷新列表的能力:

let g:Netrw_UserMaps = [["<C-l>","MoveCursorToWindowOnTheRight"]]
function! MoveCursorToWindowOnTheRight(islocal)
    return "wincmd l"
endfunction

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM