I was trying to create a bookmark file for my configs, and search for them using fzf.
I tried both these methods but with no avail.
editconf() { nvim $(cat /home/anupam/scripts/conflist | fzf) }
editconf() { cat /home/anupam/scripts/conflist | fzf | xargs nvim }
The problem that's occurring is it's passing the path say '~/.config/nvim/init.vim' as a string instead of a file path ~/.config/nvim/init.vim.
and nvim thinks that it's the file name instead of file path.
Any way of solving this.
PS I tried to remove the quotes using tr didn't work.
~there. Tilde expansion is done by the shell. Neovim might do it when using:e,:tabe, etc., but not when it's passed literally as an argument. Try with/home/anupaminstead of~.editconf() { nvim ${(f)"$(</home/anupam/scripts/conflist fzf)"}; }.$(...)splits on all$IFScharacters while you likely want to split on newline only (or not at all in which case that would beeditconf() { nvim "$(< /home/anupam/scripts/conflist fzf)"; }. In any case concatenating a single file doesn't make much sense,catis redundant here.