4

我最近偶然发现了 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”映射吗?

4

1 回答 1

2

在 netrw 内部,C映射看起来就像它刚刚映射到

:let g:netrw_chgwin = winnr()

如果你做 a: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

所以与 netrw 缓冲区的本地C相同:let g:netrw_chgwin= winnr()<CR>

于 2013-05-28T00:05:49.650 回答