Closed victoriastuart closed 3 years ago
I'm sorry but I've no idea about
In NERDtree, with a open directory I was able to search a term, and use n | Shift-N to navigate through those matches.
Could you explain the feature with some screencast or screenshots?
Or do you just talking about Vim's search feature by hitting /
or ?
?
The latter: open the fern.vim
drawer, then search (Vim: /
) for a string. In a document, n/N
will find the next/previous match. I'm not seeing that in the fern
drawer.
It seems search works as expect in my environment. Note that N
is mapped to "New file" in default thus N
does not work unless you disable the mapping.
Please make a minimal vimrc and minimal steps to reproduce. Starts from the following vimrc
if exists('+compatible') && &compatible
set nocompatible
endif
if has('nvim')
set runtimepath^=~/.vim
set runtimepath+=~/.vim/after
set packpath^=~/.vim
endif
" Specify fern.vim directory here
set runtimepath+=~/fern.vim
packloadall
filetype plugin indent on
syntax on
echomsg "Custom vimrc has loaded"
Hi again - thank you for your response, appreciated. I commented out the nmap <buffer> N <Plug>(fern-action-new-file)
line and looked around my .vimrc
but didn't see anything of note.
With that change, in the fern.vim
drawer I can do a /
search as in a regular buffer (and the NERDtree
buffer) and when I press n
to find the next match, it goes to that line and stays there, even if there are more matches in following lines.
If there are gaps (non-matched lines) between search results, I can navigate (j
) below the current match, then n
again takes me to (only) the next match and stays there (even if more matches, below) - unless I repeat the preceding steps at each stall.
The reverse search, N
, works normally.
Again, this is only in the fern.vim
buffer / drawer.
I also tried your minimal .vimrc
with the fern.vim
settings but it wouldn't work properly -- missing other things apparently to make this work. Frankly, I'm not interested in pursuing that approach, as if needed I'll return to NERDtree
and use netrw
for opening directories with large (100s / 1000s) files.
Screencast (me >> Youtube): https://youtu.be/LeBZaMl_MNU
Well, "I" need minimal vimrc and steps to reproduce your situation. Otherwise I cannot fix or help. That's why I'm asking you to start from that minimal vimrc.
Anyway, it's fine if you go back to NERDTree or netrw or whatever. It's up to you. Please close this issue then.
You can use any other file manager plugins. They are free to use and no warranty.
Maybe the following helps?
let g:fern#disable_viewer_smart_cursor = 1
Adding
let g:fern#disable_viewer_smart_cursor = 1
to the minimal .vimrc"
(comments below) PARTIALLY solved the /-search issue:
n
(forward) worked;N
(reverse search) brought up the New file:
dialog (rather than searching).HOWEVER, adding
let g:fern#disable_viewer_smart_cursor = 1
to my full ~/.vimrc
restored a properly working Vim
/-search (n
: forward | N
: reverse).
Here is the issue / frustration I had with the "minimal" .vimrc
(note the number of paths to identically-named, yet different, fern.vim
files).
if exists('+compatible') && &compatible
set nocompatible
endif
if has('nvim')
set runtimepath^=~/.vim
set runtimepath+=~/.vim/after
set packpath^=~/.vim
endif
" Specify fern.vim directory here
" set runtimepath+=~/fern.vim
" In sequential order
" (re: `find` command, `fern.vim`, `fern` installed via `vim-plug):
" Restart Vim to reload.
" YES:
set runtimepath+=/home/victoria/.vim/plugged/fern.vim
" ... BUT no Vim /-search `n' only finds / stalls at first match,
" and `N` calls 'New file: '.
" NOPE ('E492: Not an editor command: Fern .'):
" set runtimepath+=/home/victoria/.vim/plugged/fern.vim/autoload/fern.vim
" set runtimepath+=/home/victoria/.vim/plugged/fern.vim/ftplugin/fern.vim
" set runtimepath+=/home/victoria/.vim/plugged/fern.vim/plugin/fern.vim
" set runtimepath+=/home/victoria/.vim/plugged/fern.vim/autoload/fern/internal/command/fern.vim
" set runtimepath+=/home/victoria/.vim/plugged/fern.vim/autoload/fern.vim
" set runtimepath+=/home/victoria/.vim/plugged/fern.vim/autoload/vital/fern.vim
" set runtimepath+=/home/victoria/.vim/plugged/fern.vim/autoload/vital/_fern.vim
packloadall
filetype plugin indent on
syntax on
echomsg "Custom vimrc has loaded"
" TEST:
" :Fern .
" `:buffers` to list buffers
" [victoria@victoria ~]$ pwd
" /home/victoria
" [victoria@victoria ~]$ find . -iname '*fern.vim'
" ./.vim/plugged/fern.vim
" ./.vim/plugged/fern.vim/ftplugin/fern.vim
" ./.vim/plugged/fern.vim/plugin/fern.vim
" ./.vim/plugged/fern.vim/autoload/fern/internal/command/fern.vim
" ./.vim/plugged/fern.vim/autoload/fern.vim
" ./.vim/plugged/fern.vim/autoload/vital/fern.vim
" ./.vim/plugged/fern.vim/autoload/vital/_fern.vim
" [victoria@victoria ~]$
[victoria@victoria .vim]$ rg . -i -e smart_cursor
./plugged/fern.vim/doc/fern.txt
333:*g:fern#smart_cursor*
421: See |g:fern#smart_cursor| for detail.
423:*g:fern#disable_viewer_smart_cursor*
425: See |g:fern#smart_cursor| for detail.
./plugged/fern.vim/autoload/fern.vim
27: \ 'smart_cursor': 'stick',
35: \ 'disable_viewer_smart_cursor': 0,
./plugged/fern.vim/autoload/fern/helper/async.vim
20: let prefix = !g:fern#disable_viewer_smart_cursor && g:fern#smart_cursor ==# 'stick' ? ' ' : ''
./plugged/fern.vim/autoload/fern/renderer/default.vim
41: let prefix = !g:fern#disable_viewer_smart_cursor && g:fern#smart_cursor ==# 'stick' ? ' ' : ''
./plugged/fern.vim/autoload/fern/internal/viewer/smart_cursor.vim
1:function! fern#internal#viewer#smart_cursor#init() abort
2: if g:fern#disable_viewer_smart_cursor
5: if g:fern#smart_cursor ==# 'stick'
7: elseif g:fern#smart_cursor ==# 'hide'
11: \ '"%s" is not valid g:fern#smart_cursor. Use "stick" instead.',
12: \ g:fern#smart_cursor,
19: augroup fern_internal_viewer_smart_cursor_init
35: augroup fern_internal_viewer_smart_cursor_init
./plugged/fern.vim/autoload/fern/internal/viewer.vim
60: call fern#internal#viewer#smart_cursor#init()
[victoria@victoria .vim]$ rg . -i -e disable_viewer_smart_cursor
./plugged/fern.vim/doc/fern.txt
423:*g:fern#disable_viewer_smart_cursor*
./plugged/fern.vim/autoload/fern.vim
35: \ 'disable_viewer_smart_cursor': 0,
./plugged/fern.vim/autoload/fern/internal/viewer/smart_cursor.vim
2: if g:fern#disable_viewer_smart_cursor
./plugged/fern.vim/autoload/fern/helper/async.vim
20: let prefix = !g:fern#disable_viewer_smart_cursor && g:fern#smart_cursor ==# 'stick' ? ' ' : ''
./plugged/fern.vim/autoload/fern/renderer/default.vim
41: let prefix = !g:fern#disable_viewer_smart_cursor && g:fern#smart_cursor ==# 'stick' ? ' ' : ''
[victoria@victoria .vim]$
/home/victoria/.vim/plugged/fern.vim/doc/fern.txt
g:fern#smart_cursor*
A type |String| of the smart cursor. Available values are
"stick" Stick the cursor to the first column to visualize the
cursor node. In this mode, single whitespace is
prefixed as a padding for better looks.
"hide" Hide the cursor and forcedly enable |cursorline| to
visualize the cursor node. In this mode, |cursorline|
is automatically enabled when the focus is on the
buffer and automatically disabled when the cursor is
out of the buffer.
Note that Neovim prior to 0.5.0 cannot hide the cursor
thus faint vertical bar is used instead.
Default: "stick"
N (reverse search) brought up the New file: dialog (rather than searching).
N
is mapped to new-file
in default though.
Anyway, it seems that setting solved the issue. Good.
Thank you for your help, earlier. I did not intend to appear ungrateful. The program looks quite useful. :-) Sincerely, ...
Hello: I just (yesterday) started using
fern.vim
, asNERDtree
was too slow opening large directories.[
netrw
opened those large directories efficiently; however, while I appreciate the native simplicity ofnetrw
, it lacks polish and features, e.g. decent bookmarking; other issues, e.g. navigation.]In
NERDtree
, with a open directory I was able to [edit: using/
-search inVim
] search a term, using the standardVim
mappingsn
|Shift-N
to navigate through those matches.How can I regain that search functionality in
fern.vim
?My
~/.vimrc
entries: