rabite0 / hunter

The fastest file manager in the galaxy!
Do What The F*ck You Want To Public License
1.32k stars 64 forks source link

Open source files in $EDITOR #100

Closed kflak closed 3 years ago

kflak commented 4 years ago

Thanks for a very nice file manager!

I am struggling with replicating the way ranger treats text files. Hitting enter shuffles ranger into the background and opens the file in my $EDITOR, which happens to be nvim. When I'm done editing and quit the file, ranger pops back into the foreground. How would I accomplish this in hunter?

Right now the behavior I'm getting is a new terminal window but no file opening...

System: Arch Linux, hunter 1.3.5, installed from AUR

kflak commented 3 years ago

Solved by editing $HOME/.config/mimeapps.list. It seems hunter uses xdg-open for all things launchwise, so instead of creating custom launchers in the action scripts, it is better to put something like this into above mentioned file:

[Added Associations]
application/json=nvim.desktop;
text/plain=nvim.desktop;
text/markdown=nvim.desktop;

[Default Applications]
application/json=nvim.desktop;
text/plain=nvim.desktop;
text/markdown=nvim.desktop;

...and so forth...