justinmk / vim-dirvish

Directory viewer for Vim :zap:
Other
1.18k stars 64 forks source link

Pressing / selects everything #141

Closed chalmagean closed 5 years ago

chalmagean commented 5 years ago

Not sure why, when I press / in a dirvish buffer, the search pattern is \ze[^\/]*[\/]\=$.

justinmk commented 5 years ago

The workaround is to simply press another key, i.e., actually search for something.

\ze[^\/]*[\/]\=$ is pre-filled to avoid matching the full path (concealed text). Without it, /foo would match /foo/bar/baz even though /foo/bar/ is concealed in the buffer. See also https://github.com/justinmk/vim-dirvish/pull/28.

You can override this by deleting the buffer-local / mapping:

autocmd FileType dirvish silent! nunmap <buffer> /

Vim's 'incsearch' matches zero-width expressions. Nothing can be done about that.