2

Is it possible to set up Dolphin file manager so that, once a file is selected, pressing a keyboard shortcut (for example Ctrl+E) will open that file in a text editor (for example, Kate), regardless of file associations?

I have a lot of SVG images that open in Inkscape when double clicked, and that is desirable behaviour, but often it is nice to be nice to open these files in a text editor like Kate. Right clicking on a file, going to the Open With... menu and selecting Kate is quite slow and tedious, especially on a laptop without a mouse. The same thing is applicable for for HTML files, md files, various executable scripts, etc...

Kresimir
  • 121

2 Answers2

0

My impression is that was possible in the past. As a workaround:

  • install xclip
  • add a custom shortcut (e.g. Ctrl+K) with the command kate -b $(xclip -o)
  • after selecting your file, copy it (Ctrl+C, which adds it to clipboard);
  • use the Kate shortcut above (Ctrl+K)
  • you can (might need to) associate a shortcut to "Open klipper at mouse position" in order to quickly see and select in the clipboard list if needed: it might be the case that the last copied file is not selected in the clipboard list.

enter image description here

If that's the case, you'll have to press that shortcut and Enter to select it in that list, before the Kate shortcut, which makes 4 keyboard actions in total... It might not be needed, in which case you have to do just two keyboard actions ...

You might find this helpful too, in order to pop-up an "open with"-like list with shortcuts.

cipricus
  • 1,479
0

I couldn't get xclip to output files copied from Dolphin, due to some meta/mime info copied along with the name; so, I couldn't get what @cipricus suggested. And since I also couldn't find how to get Dolphin to open files based on mime types (for example, all text files) as it only seems to look at file extensions, which I don't use in linux for text files.

So what I did in the end was just start using file extensions. Now all my nginx config files end with .nginx and Dolphin is happy and I can edit them by double clicking in Dolphin.