I was trying to get fasd
working with neovim's equivalent of viminfo, which is shada.
_FASD_VIMINFO="$XDG_DATA_HOME/nvim/shada/main.shada"
Has anyone had any luck with this? I'm guessing the shada file is not in the same format as viminfo, and thus the solution is that I need to create a new backend. Just wanted to ask here in case someone else has already hit this.
I made something similar with neovim's python interface.
You can check it out
https://github.com/haifengkao/nfasd
this is all I do https://github.com/nhooyr/dotfiles/blob/4605ab8a76dead31f09b2592838485e1a6445794/.config/nvim/init.vim#L70-L80
I can even access it with fzf in neovim!
brilliant!!
nfasd has gone beyond the original goal. It now has folder completion, and better file ordering.
actually I am using it to replace fasd gradually.
besides, it's written in Python (~_^)
EDIT: Nevermind, @nhooyr's solution works perfectly.
I believe this discussion got side-tracked. What I need (and @rosshadden too I believe) is for fasd
to index—and include as an option in its results—files that I've opened only from inside NeoVim.
:e file.sh
).file.sh
using $ neovim f,file.sh<TAB>
.fasd
doesn't know I've ever opened file.sh
.I also thought that it would be a good idea to write a back-end for neovim. Having said that, I think the vim-script solution above works well enough for me so I'm just going to stick with that for now. Wouldn't this work well on the readme or somewhere in the wiki or something ?
here's a rough fasd backend for neovim's shada file. I have this in my ~/.fasdrc
:
shada() {
~/code/neovim/scripts/shadacat.py ~/.local/share/nvim/shada/main.shada 'entry.type.value == 10' | \
sed -n "s/^.*'f': '\([^']*\)'.*$/\1/p" | \
awk -v t="$(date +%s)" '{
if (!seen[$0]) {
t -= 60
print $0 "|1|" t
}
seen[$0] = 1
}'
}
Most helpful comment
this is all I do https://github.com/nhooyr/dotfiles/blob/4605ab8a76dead31f09b2592838485e1a6445794/.config/nvim/init.vim#L70-L80
I can even access it with fzf in neovim!