Opening a file from .netrw in a given splitting

This is the same question as on SuperUser , but I feel that he is more likely to get an answer here, so ...

In Vim, I have four splits - two into two - and there is no netrw in the upper left corner. Is there a way to open a file from netrw in the lower right section, in the lower left corner, etc.?

+5
source share
3 answers

here are some tips https://superuser.com/questions/377501/keep-cursor-in-netrw-window-when-browsing-files-in-vim

Put this in your .vimrc,

let g:netrw_preview = 1

, , , p, . , Ctrl W z.

, vim , , " ". , .

:help netrw-preview
:help CTRL-W_z

:help netrw

netrw.

+9

g:netrw_chgwin, netrw . :

:h netrw-C

, netrw, :

:let g:netrw_chgwin = winnr()

- netrw (:E), C, netrw <c-o>.

+2

: netrw ( : let g: netrw_liststyle = 2):

    -------------------------------- ...
    Netrw-split: topleft spilt
    -------------------------------- ...
             |          |          |
    working  | working  | working  |
    window 1 | window 2 | window 3 | ...
             |          |          |

, Netrw-split . .vimrc:

    augroup netrw
        autocmd!
        autocmd WinLeave * if &ft !=# "netrw" | let g:netrw_chgwin = winnr() | endif
        autocmd filetype netrw call Netrw_mappings()
    augroup END

WinLeave g: netrw_chgwin ( , netrw). , netrw , , netrw .

Autocmd 'filetype' , netrw. netrw '%' :

    function! Netrw_mappings()
        noremap <buffer>% :call CreateInLastWindow()<cr>
    endfunction

g: netrw_chgwin:

    function! CreateInLastWindow()
        let l:filename = input("new file name: ")
        let l:netrwdir = b:netrw_curdir
        execute g:netrw_chgwin . "wincmd w"
        execute 'edit'. l: netrwdir. '/'. l: filename
    endfunction

0
source

All Articles