notational-fzf-vim
notational-fzf-vim copied to clipboard
Some files are missing (too many?)
I have a directory with 6,700 files in it. Not all of them show up, either when searching by filename or contents.
When running :NV
the counter shows 27731. It wouldn't surprise me if that's too low.
If I run fzf
separately, there are no issues matching by filename.
Anything I can do? (Thanks)
macOS 10.15.7 (Catalina) VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Sep 24 2021 06:02:32) ripgrep 13.0.0 (homebrew)
Hi, I have the same challenge on my Debian bullseye. FZF finds my files all the time (so sometimes I am forced to drop out of NV
, and switch to fzf-vim
to find my notes at filename level and use ctrl-v
to open via FZF
mappings). The bigger prob for me is the inconsistency if I can't find something I know must exist. If I just start NV a few times after each other and each time immediately kill it with say control c or d
, then every time I get a different nr of found files in the counter. Doing it over and over (sorry, I didn't count) it eventually find the files I knew existed (sometimes). Just also weird that once you search file name, then it lists every line in the file as a separate found item instead of just showing one line per file, maybe it gets a bit of an issue cause some of my files are showing like 500 lines etc . And that's actually not big files ?
Debian 11 bullseye
ripgrep 12.1.1
-SIMD -AVX (compiled)
+SIMD +AVX (runtime)
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Oct 01 2021 01:51:08)
Included patches: 1-2434
Extra patches: 8.2.3402, 8.2.3403, 8.2.3409, 8.2.3428
okay, I guess the tool is now unreliable and not supported anymore. Any other recommendations for something similar easy and lightweight that can integrate with Vim?
I see if I restrict the search upfront, then I get my missing files. i.e, I have a file containing the text "lynx" in my NV main dir (which is also in my NV search paths as the 1st dir )
When I just use :NV
, I get this inconsistent number of files found behaviour as I described above, but I also do not find what I was looking for. However, when I use :NV lynx
I get about 3 lines found and get the file/note I was looking for. Unfortunately, I don't know how to map something with a supplied user variable, so my :NV user_supplied_variable
. this also means I have to be in Vim and the CLI script that I used to start Vim with :NV
from outside Vim also won't work anymore.
I am unsure what the cause is or how to try and fix this, but I will struggle along like this until I can find another tool I can use instead.
okay, I created a workaround function that will take user input as an initial input to :NV
and also changed my CLI alias to make that work. It does help and I can see the files/notes I am looking for now. I will continue to use this with the little workaround until I can find something better.
here are the function and mapping changes I added to my .vimrc in case someone else has the same issue etc..
"Notational function to work around unsurported bug where not all
"notes are found , see github for missing file bug.
function MyNV()
let my_init_search = input("search limiter string : ")
exe 'NV' my_init_search
endfunction
"notational keybindings.
nnoremap <silent> <leader>n :call MyNV()<CR><C-H>
vnoremap <silent> <leader>n <C-C>:call MyNV()<CR>
inoremap <silent> <leader>n <C-O>:call MyNV()<CR>
And here's the line I added to .bash_aliases to execute it anywhere from the CLI directly :
# Start Vim with notational fzf vim and use the string workaround function as per vimrc comments.
alias nv="vim -c ':call MyNV()
Now in Vim, I can simply do <myleader>n
in any mode and it will prompt for input which it will use as a search delimiter. If I just press enter it will work as normal :NV
(but then the missing file bug is present).
from the CLI I just also nv
and it will start Vim, ready for the above-described input.
as I am writing this, it seems there may be a memory error/limit of some sort if one has lots of notes/files and does not delimit the search.