Skip to content

Seamless Sublime Text 3 Integration

Martin Kemp edited this page Feb 26, 2014 · 7 revisions

A thousand thanks to expositor for this guide. 👍


untitled

For all you Windows developers using cmder, here is a neat way to integrate cmder and sublime text to work seamlessly.

Step 1: Create a new folder called 'Sublime Text 3' in the '/cmder/vendor/' location. You should also see the folders /clink, /conemu-maximus5, and /mysgit.

Step 2: Download a portable version of Sublime Text 3 from their website and unzip the content into the newly created Sublime Text 3 folder.

Step 3: Then, in the aliases file under /cmder/config/aliases, add:

subl="%CMDER_ROOT%\vendor\Sublime Text 3\sublime_text.exe" $1 -new_console:s75V

You can change 'subl' with any alias you want, hopefully one that doesn't conflict with an existing command.

Like the view above, the -new_console:s75V will split the console horizontally where sublime will take up 75% of the view. You can also change the split behavior. Here are some other examples:

-new_console:s or -new_console:s50H

Split will be created to the right, both splits becomes 50%. untitled4

-new_console:s50V

Split will be created horizontally, both splits becomes 50%. untitledg

Step 4: Start or restart cmder and type 'subl' and a file name. For example:

C:\Users\Foo
λ subl foo.txt

Foo.txt should open in sublime text 3 and split your screen. If 'foo.txt' exists, it should open that file, otherwise, it will create a new 'foo.txt' file in your directory. Here, I didn't have a foo.txt file in my directory when I typed that command. After pressing Ctrl S, it created a new foo.txt and saved it in the current working directory. Check out the status on the bottom.

untitledhj

Of course, to make it look extra integrated, I removed the tabs in sublime. For the minimalists, you can even remove the menu bar and the status bar, so it looks like a complete extension of the cmder. Honestly, I prefer the menu bar.

untitled2

Remember, you can you can always open the menu again by pressing 'Alt'. Also, in the conemu setting, I changed the tab group in the Features-->settings and checked 'one tab per group'. Again, for the minimalists, you can even remove the tabs completely. Just be sure to remember all your shortcuts!

Minimalist setup right here:

Horizontal Split. untitledd

Vertical Split untitledf

Another neat timesaving tip is that you can autocomplete queries by pressing TAB. So if the filename is called Vagrantfile, then all you have to do is type subl vag and press TAB, and it should auto-complete.

Step 5: To quickly exit sublime, you just press Alt F X. And you're back to your cmd. Pretty sweet!

**Bonus Step 6:**To make sublime text not remember your previously opened files, in Sublime, under Preferences-->Settings - User, put:

// Settings in here override those in "Default/Preferences.sublime-settings",
// and are overridden in turn by file type specific settings.
{
	"hot_exit": false,
	"remember_open_files": false
}

So now, when you just type 'subl', see that it creates a blank document.

C:\Users\Foo
λ subl

untitled1

Clone this wiki locally