Wednesday, 30 March 2016

Add action to Thunar context menu "Open gVim Here" on Xubuntu

I will show you a quick tip on how to add a custom action to the file browser (Thunar) context menu on Xubuntu to open gVim with the current directory set as the working directory, similar to the "Open Terminal Here" shortcut.

To create the action, open Thunar and go to "Edit -> Configure custom actions...". Click on the "+" icon to create a new action.



Type in a name, and use the following command to do the magic:
vim -g -c "execute 'cd' . %f"
You can now select an icon by clicking on the button next to "Icon" and searching for gVim. Next, switch to the "Appearance Conditions" tab and select only "Directories". Now your all set! To confirm if it works, issue a :pwd after gVim has started.
 

No comments:

Post a Comment