Closed francium closed 3 years ago
I just tried without vim-tmux-navigator and with just defx + these mappings:
nmap <C-J> <C-W><C-J>
nmap <C-K> <C-W><C-K>
nmap <C-L> <C-W><C-L>
nmap <C-H> <C-W><C-H>
Same result, I can move between non-defx splits fine, and I can move into defx split from a non-defx split using one of these mappings. But once inside defx split, I can't use anything except <c-w>
+h
/j
/k
/l
to move out.
Really? Please wait.
set runtimepath+=~/work/defx.nvim
set runtimepath+=~/work/nvim-yarp/
set runtimepath+=~/work/vim-hug-neovim-rpc/
augroup vimrc_defx
autocmd!
autocmd VimEnter * call Setup_Defx()
augroup END
function! Setup_Defx() abort
call defx#custom#option('_', {
\ 'winwidth': 30,
\ 'split': 'vertical',
\ 'direction': 'topleft',
\ 'show_ignored_files': 0,
\ 'buffer_name': 'defxplorer',
\ 'columns': 'indent:filename',
\ })
endfunction
nmap <C-J> <C-W><C-J>
nmap <C-K> <C-W><C-K>
nmap <C-L> <C-W><C-L>
nmap <C-H> <C-W><C-H>
It works for me.
I think you have not tested the minimal vimrc.
And you should use nnoremap
instead of nmap
.
@Shougo No I definitely tested my minimal vimrc, I commented out rest of my config, and only had those lines of config I've included above.
But let me try with just what you've pasted, I'll double check if you say it's working for you. Thanks for the quick reply also!
Just tested your config. You're correct, it does work. So something I've done is incorrect. I'll narrow down the issue myself. Thank you for your help!
I also broke vim-tmux-navigator when I copied the default defx configuration. In my case, it was because the default config maps <C-L>
to redraw
, which was overriding the vim-tmux-navigator mapping of <C-L>
to go right
.
Fixed by changing that mapping in my defx config.
Problems summary
I've got
<c-h>
,<c-j>
,<c-k>
,<c-l>
mapped to move between splits instead of having to type<c-w>
+h
/j
/k
/l
I've also got vim-tmux-navigator that allows seamless movement using those same mappings between vim and tmux splits.I've only recently started looking at NERDTree alternatively. I'd like to give defx a try, but I'm seeing an issue with these set of mappings. With NERDTree these mappings were working fine and I could move between NERDTree, other vim splits and tmux splits seamlessly.
Expected
Use
<c-h>
,<c-j>
,<c-k>
,<c-l>
to move between defx and vim splitsEnvironment Information
plugin version(SHA1):
OS: Linux
neovim/Vim version: NVIM v0.5.0
:checkhealth
or:CheckHealth
result(neovim only):health#defx#check
defx.nvim
health#nvim#check
Configuration
Performance
Remote Plugins
terminal
health#provider#check
Clipboard (optional)
Python 2 provider (optional)
import neovim
. Using the first available executable for diagnostics.Python 3 provider (optional)
g:python3_host_prog
is not set. Searching for python3 in the environment.g:python3_host_prog
. This will avoid the need to install the pynvim module in each version/virtualenv.Python virtualenv
Ruby provider (optional)
ruby
andgem
must be in $PATH.ruby
andgem
commands work.Node.js provider (optional)
node
andnpm
(oryarn
) must be in $PATH.node
andnpm
(oryarn
) commands work.Perl provider (optional)
health#treesitter#check
Checking treesitter configuration
Provide a minimal init.vim/vimrc with less than 50 lines (Required!)
The reproduce ways from neovim/Vim starting (Required!)
:sp
to create a new split<c-j>
,<c-k>
to move between them<leader><tab>
to open defx<c-h>
to move to into defx split<c-l>
to move out of defx