I use the enter key as my leader:
nnoremap <cr> <nop> " To avoid moving the cursor let mapleader="\<enter>"
So far so good. To have the same behavior on Dirvish I need to remap enter to
<nop> again, otherwise when I press it, it navigates to the path under the cursor (which I don't need because
gf is already burned in my brain):
augroup DirvishSetUp autocmd! autocmd FileType dirvish \ nnoremap <buffer> <cr> <nop> | \ nnoremap <buffer> <silent> gf :call dirvish#open('edit', 0)<cr> augroup END
It works as expected, except for an annoying little detail: If I searched something previously, on any buffer, and press the enter key on the Dirvish one and wait, the last search gets repeated.
:nmap shows the following for
n <CR> *@<nop><Space> n <CR> * <Nop>
Why is this happening? (Not sure if relevant, but this is on Neovim 0.4.3)