I created plugin for sublime text 3
with 3 commands:
2 of them are of type TextCommand
, one of them is WindowCommand
import sublime, sublime_plugin
class simple_text_pluginCommand(sublime_plugin.TextCommand):
def run(self, edit):
print("Hello World simple_text_plugin")
class simple_text_plugin2Command(sublime_plugin.TextCommand):
def run(self, edit):
print("Hello World simple_text_plugin2")
class simple_window_pluginCommand(sublime_plugin.WindowCommand):
def run(self):
print("Hello World simple_window_plugin")
Why I can call from sublime command line
(ctrl + `) only text commands:
>>> view.run_command('simple_text_plugin')
Hello World simple_text_plugin
>>> view.run_command('simple_text_plugin2')
Hello World simple_text_plugin2
But cannot call window
command:
>>> view.run_command('simple_window_plugin')
Got no output. How to run Window
type plugin from sublime console
?
Command Line Interface – Sublime Text Documentation DownloadBuySupportNewsForum DocumentationCommand Line Interface Version: Dev4.03.23.13.0 Sublime Text includes a command line tool, subl, to work with files on the command line.
1 Open any program file in the sublime editor and Right-click ( context menu ). 2 You can see the Cmd menu in Context menu options. 3 Click on it. 4 The command prompt will be opened through which you can compile and run your program.
Terminus is a recent plugin, highly under development. It's the best cross-platform console in Sublime Text that I have seen yet. Show activity on this post. Will Bond created an excellent plugin for called " Terminal " for calling the terminal at project or file levels.
32bit installs on a 64bit version of Windows will be in C:\Program Files (x86)\Sublime Text\ 32bit installs on a 32bit version of Windows will be in C:\Program Files\Sublime Text\ Windows 8 Show instructions for: Windows 10, Windows 7 Press the Windows Keyand type environ Select the item Edit the system environment variables
ApplicationCommand
: sublime.run_command('application_command_name')
. Check run_command
function for sublime
module in the API reference.WindowCommand
: window.run_command('window_command_name')
. Check run_command
method of sublime.Window
.TextCommand
: view.run_command('text_command_name')
. Check run_command
method of sublime.View
.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With