Reputation: 5647
Problem:
:Lex
to open netrw file explorer and open a file in a vertical split using v
v
, I get the expected behaviour as shown in the 2nd image below..vimrc settings:
let g:netrw_banner = 0
let g:netrw_liststyle = 3
let g:netrw_altv = 1
let g:netrw_winsize = 25
noremap <C-x> :Lex<CR>
autocmd FileType netrw setl bufhidden=wipe
Upvotes: 5
Views: 1441
Reputation: 11
:Iexplore
sets the g:netrw_chegwin
variable so that all subsequent :Explore
split commands will also open the selected buffer on the same window as :Lexplore
If you use :Lex
, the variable g:netrw_chegwin
gets set to 2
, and even after you close the :Flex window, the variable remains set.
So if, for example you use :Sex
after using :Lex
, the file that you select will open in the window that was being used by :Lex
, which is probably not what you want.
To make :Explore
splits behave as they normally do, you can reset by:
let g:netrw_chgwin = -1
Upvotes: 0
Reputation: 11
You need to select an open directory as working
add in your expression: %:p:h
%
- current file name:p
- expand to full path:h
- head (last path component removed)nnoremap <leader>dd :Lexplore %:p:h<CR>
Upvotes: 0