vim – 如何使用netrw-C?

我最近在Netrw上发现了一个名为netrw-C的功能.来自文档:

SETTING EDITING WINDOW                  *netrw-C* {{{2

One may select a netrw window for editing with the "C" mapping, or by setting
g:netrw_chgwin to the selected window number.  Subsequent selection of a file
to edit (|netrw-cr|) will use that window.

Related topics:         |netrw-cr|
Associated setting variables:   |g:netrw_chgwin|

我已设法通过手动设置实现所描述的行为
g:netrw_chgwin但我无法理解或发现“C”映射的工作原理.

是的,我可以映射

:let g:netrw_chgwin = winnr()

但我很好奇原始的netrw-C映射是如何工作的.

有谁知道如何使用文档中描述的“C”映射?

最佳答案 在netrw内部,C映射看起来就像它刚映射到的那样

:let g:netrw_chgwin = winnr()

如果您执行:map C,您将获得输出

n  C           *@:let g:netrw_chgwin= winnr()<CR> 

:h map-listing

Just before the {rhs} a special character can appear:
    *       indicates that it is not remappable
    @       indicates a buffer-local mapping

因此C与以下相同:let g:netrw_chgwin = winnr()< CR>这只是netrw缓冲区的本地.

点赞