如何使用netrw-C?

时间:2013-05-27 19:41:48

标签: vim netrw

我最近在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”映射吗?

1 个答案:

答案 0 :(得分:2)

在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与netrw缓冲区本地的:let g:netrw_chgwin= winnr()<CR>相同。