Skip to content

Instantly share code, notes, and snippets.

@byassine52
Created July 2, 2021 10:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save byassine52/d2bc03471bedf6a91599ba00ea99af06 to your computer and use it in GitHub Desktop.
Save byassine52/d2bc03471bedf6a91599ba00ea99af06 to your computer and use it in GitHub Desktop.
Sublime Text 3 - Plugin to "Open File by Path" quick access
...
////////////////////////////////
// Open File by Path shortcut //
////////////////////////////////
{ "keys": ["ctrl+shift+o"], "command": "open_file_by_path" },
...
[
{
"id": "file",
"children":
[
{
"id": "open_file_by_path",
"command": "open_file_by_path",
"caption": "Open File by Path...",
"mnemonic": "F"
}
]
}
]
import sublime, sublime_plugin
def open_file(window, filename):
window.open_file(filename, sublime.ENCODED_POSITION)
class OpenFileByPathCommand(sublime_plugin.WindowCommand):
def run(self):
def done_callback(filename):
open_file(self.window, filename)
self.window.show_input_panel("Open File by Path: ", "", done_callback, None, None)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment