

I wanted to replicate the same thing on windows, so wrote a simple script that enables it. Modify this as needed for Sublime Text 3 (or any future versions). In Mac, you can open sublime text 2 from terminal, and it’s really handy. I added this to my PowerShell profile: Set-Alias subl 'C:\Program Files\Sublime Text 2\sublime_text.exe' Or you may as well modify your system PATH variable to include sublime's instalation folder, but I believe that is much more involved. All commands should be added without the ''.
SUBLIME TEXT WINDOWS COMMAND LIME PRO
Pro tip: if you want to shorten the sublime command you can rename your sublime.exe to subl.exe, restart command line and type 'subl' this will now launch the text editor. So, you cannot do anything else in terminal, unless you open another terminal. If sublime text is not open already, when you open sublime text with subl, the command prompt will wait until sublime text is closed. You may then use in your terminal/console subl as a command to open whatever file, such as in your example: Step 5: restart the command line, and type 'sublime', this will launch the Sublime Text 2 editor. You can open sublime text from command line with subl.exe and subl.

It is at sublime's installation folder: copy it in to a folder included in the system path. bat file set to autorun with cmd) so I can type subl file.rb: > doskey subl="C:\Program Files\Sublime Text 2\sublime_text.exe" $*įor the default bash shell add an alias to your ~/.bashrc file, e.g: $ echo 'alias subl="/cygdrive/c/Program\ Files/Sublime\ Text\ 2/sublime_text.exe"' > ~/.bashrcįrom build 3065 (Release Date: 29 August 2014) onwards Sublime text includes a command line helper, nameley subl.exe.

For Windows cmd.exe you could just add the sublime text installation directory to your PATH environment variable, this would allow you to type: sublime_text file.rb
