- Notifications
You must be signed in to change notification settings - Fork2.1k
Seamless Sublime Text 3 Integration
For all you Windows developers using cmder, here's a method to integrateSublime Text 3 to work seamlessly in Cmder.
This is aneat feature of ConEmu that allows you to integrate any window into Cmder.
- You have thelatest cmder release installed
- The
%CMDER_ROOT%environment variable is correctly set (How to?)
Assuming that we refer to the Cmder installation folder as[cmder_root]:
Download the latestportable version ofSublime Text 3 (stable) orSublime Text 3 (dev) .zip file.
Createa new folder called "Sublime Text 3" at this path:
[cmder_root]\bin\Sublime_Text_3Extract the contents of theSublime Text 3 .zip file into the newly created folder
Add the following line to your aliases in
[cmder_root]\config\user_aliases.cmd:subl="%CMDER_ROOT%\bin\Sublime_Text_3\sublime_text.exe" $*Refer toSplit-pane integration section for splitting options.
NOTE: Naturally you can replace
sublalias with whatever alias you have in mind, as long as it doesn't conflict with an existing command.Restart cmder, and you're done.
Open Cmder and type 'subl' following a file name. For example:
C:\Users\Fooλ subl bar.txtAssuming that you are in theC:\Users\Foo directory within the cmder UI, this should openbar.txt in Sublime Text 3 and split the view.
- If you want to edit a
long-boring-file-name.txtwithin the current working directory, typingsubl longand hittingTAB will autocomplete your partial input tosubl long-boring-file-name.txt.
Tip: If thebar.txt does not exist, sublime will create a new file with the same name in the working directory. Watch thestatus-bar in the bottom.
You may close sublime usingFile → Exit from menu (orAlt +F +X) to go back to command-line in Cmder.
It is also possible to merge theSublime Text 3 UI into a Cmder tab, bysplitting the view into eitherhorizontal orvertical panes.
You can change the split behavior using the-new_console:s switch.
For example,-new_console:s75V will split the consolehorizontally where sublime will take up 75% of the view.
Edit theuser-aliases.cmd file to use any of the following switches:
sublv="%CMDER_ROOT%\bin\Sublime_Text_3\sublime_text.exe" $* -new_console:ssublv5="%CMDER_ROOT%\bin\Sublime_Text_3\sublime_text.exe" $* -new_console:s50Hsubls5="%CMDER_ROOT%\bin\Sublime_Text_3\sublime_text.exe" $* -new_console:s50Vsubls75="%CMDER_ROOT%\bin\Sublime_Text_3\sublime_text.exe" $* -new_console:s75V✅ By default,-new_console:s is equivalent to-new_console:s50H.
Don't forget to reload aliases withalias /reload after each change!
To make your sublime look better in Cmder, you can also remove further elements from Sublime Text 3.
You can remove themenu bar to make sublime look like an extension of Cmder.
To access the menu bar in sublime, you can always pressAlt.
For the minimalists, you can even remove the tabs completely.
Just be sure to remember all your shortcuts!
| Horizontal Split | Vertical Split |
|---|---|
- You can change the tab group settings of Cmder inFeatures → Settings and check "one tab per group".
- To quickly exit sublime, just pressAlt +F +X (File → Exit from the main menu).
- To close the current tab in sublime, useCtrl +W.
- To make sublime not remember your previously opened files, change these toPreferences → Settings from the main menu.
"hot_exit": false"remember_open_files": false
Guide based on ideas from@expositor.