How to open a shell in the directory of the file you’re currently editing in Geany.
Shell here!
Apologies if you were expecting something WordPress-related. This article is NOT about WordPress. It’s about opening a shell here and now, in the directory of the file you’re currently editing.
Geany is the perfect IDE for any type of coding that is not your main development. I use it all the time for scripting, configuring, building, tooling, installing, uninstalling, and generally nerding out.
Geany, open sesame err, shell!
Go to Tools and then to Plugin Manager. Enable the File Browser. The file browser will appear as a new tab on the left-hand-side of the screen, along with Symbols and Documents. Now you can observe your file in its native habitat, the directory.
Now if you go to Edit and then select Plugin Preferences, you should see a field titled External Open Command which defaults to
nautilus "%d"
If you’re on Ubuntu, you’re probably using gnome-terminal
as your terminal emulator. Change the line to
gnome-terminal --working-directory="%d"
Also click on Follow the path of the current file. It makes sure that the File Browser shows you the directory of the current file as you switch between editor tabs.
Now, when you right-click on a file, and choose Open Externally, you will get a new shell in the directory where that file resides.
But I miss nautilus!
If you’re missing the ability to open nautilus
, just remember that once you have a terminal open, you can always issue this command:
nautilus .
(Note the dot, which is the current directory.)
If you know of a better/faster way that doesn’t involve writing a plugin, please comment. I’d like to know.