How to use netrw-c?

I recently settled on a function in netrw called netrw-C . From the docs:

 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| 

I managed to execute the described behavior manually g:netrw_chgwin , but I could not understand or find how this β€œC” works.

Yes, I could just display

 :let g:netrw_chgwin = winnr() 

but I'm curious how the original netrw-C mapping netrw-C .

Does anyone know how to use the "C" mapping described in the docs?

+4
source share
1 answer

While inside netrw, the C mapping looks like it just maps to

 :let g:netrw_chgwin = winnr() 

If you do :map C , you get the output

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

From :h map-listing

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

So, C matches :let g:netrw_chgwin= winnr()<CR> , which is only local to the netrw buffer.

+2
source

Source: https://habr.com/ru/post/1483023/


All Articles