Skip to content

Instantly share code, notes, and snippets.

@Aaron3
Forked from hoffstein/Default (Windows).sublime-keymap
Last active December 16, 2015 03:49
Show Gist options
  • Save Aaron3/5372437 to your computer and use it in GitHub Desktop.
Save Aaron3/5372437 to your computer and use it in GitHub Desktop.
Quick script to open a file's parent folder in the file manager in ubuntu. #Install to ~/.config/sublime-text-3/Packages/User/
[
{ "keys": ["ctrl+shift+e"], "command": "open_folder_in_nautilus" }
]
import sublime, sublime_plugin, os, subprocess
class OpenFolderInNautilusCommand(sublime_plugin.TextCommand):
def run(self, edit):
if self.view.file_name():
folder_name, file_name = os.path.split(self.view.file_name())
self.view.window().run_command('exec', {'cmd': ['nautilus ' + folder_name], 'shell':True} )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment