Matt-A-Bennett / Matt-A-Bennett.github.io

0 stars 0 forks source link

https://matt-a-bennett.github.io/fzf_launcher/fzf_launcher.html #5

Open utterances-bot opened 3 months ago

utterances-bot commented 3 months ago

Using FZF to select files for any program or command | Matthew Bennett

I am a data scientist working on time series forecasting (using R and Python 3) at the London Ambulance Service NHS Trust. I earned my PhD in cognitive neuroscience at the University of Glasgow working with fmri data and neural networks. I favour linux machines, and working in the terminal with Vim as my editor of choice.

https://matt-a-bennett.github.io/fzf_launcher/fzf_launcher.html

itsgabz commented 3 months ago

Thanks for this great idea, I tried the script, first it would not run and i'd get some weird errors pertaining to carriage returns, figured that i need to change the file mode in Neovim to Unix instead of DOS, and also that i needed to call the function from within the bash script. I called it at the end of the script with f (no arguments), which never ended up catching the arguments on the command line since they were overridden, so i removed the function altogether and just kept the script unwrapped. still some struggles, but great idea, hoping to make it work. PS: i am using bash through cygwin on Windows 10. thanks again.

Matt-A-Bennett commented 3 months ago

You should be able to put the function in your ~/.bashrc file (then it would be sourced automatically when you start a new shell) and from there typing f vlc or f vim would start fzf, you select your file, and it opens.

I hope it works for you!