This tutorial will help you set Sublime Text 3 on Windows Systems up, to launch Sublime text 3 from Windows Command Line – CMD or Windows Power Shell with subl command.
Create a User variable – subl
To create a new user variable on your system, click Windows menu button and look for “variable” and click the following option otherwise you can go to system’s variables from control panel as well.
Perfect, now click the environment varialbes.
Let’s create a new user variable by clicking new button from the upper section.
Locate the sublime text exe file path on your system. This is how it is on my Windows 10 64 bit system. Copy it.
C:\Program Files\Sublime Text 3\sublime_text.exe
Create a New User Variable
Now, launch System Environment Variables windows and create a new user variable to launch sublime text with from CMD or PowerShell. Give it a name, I have given subl and paste the Sublime text 3 exe file path in the variable value field and click OK.
Add Sublime Text to System Variable Path
Select path from either top User Variables or bottom system variable and then click edit.
To add Sublime text to the environment variable, copy the Sublime Text 3 directory and click NEW on right top and paste the Sublime Text 3 directory. and click ok*3 …
Again just copy the Sublime Text directory path, and create a new ENV variable path.
Open Sublime Text with Windows command line CMD or Power Shell
Finally, relaunch your power shell or cmd or command line interface and locate to folder or directory that you want to open with sublime text and type subl .
“.” means open the current directory with sublime text, so don’t forget to add dot sign when you want to open any particular folder with subl
C:\Users\TubeMint>subl .
Disable Sublime Text Hot Reload
To prevent the opening of previous projects, you should set the following properties of your Sublime User Settings:
- Preferences
- Settings
- Add the following lines to the right window
- Save it
- Relaunch Sublime Text
"hot_exit": false,
"remember_open_files": false
Adding Terminal to Sublime Text like VS CODE
To add terminal to Sublime text, like VS Code has, you need to install package ‘terminus’ and add your preferences to the terminus keybindings.
- Press CTRL + SHIFT + P
- Type “install package”
- Hit Enter
- Type ‘terminus’
- Install Terminus Package
Add Keybinding Preferences to terminus
- Preferences
- Package Settings
- Terminus
- Key Bindings
- Add The Following Lines of Code
- Save and Relaunch STE
{
"keys": ["alt+1"], "command": "toggle_terminus_panel"
},
{
"keys": ["ctrl+alt+t"],
"command": "terminus_open",
"args": {
"post_window_hooks": [
["carry_file_to_pane", {"direction": "down"}]
]
}
}
Press ‘ALT+`’ to open terminal panel
Press ‘ ctrl+alt+t’ to open terminal in a window
Open Linux terminal with terminus and change terminal color too
Remove [ ] from the file
- Preferences
- Package Settings
- Terminus
- Settings
{
"default_config": {
"linux": "login shell", // login shell
"osx": null, // login shell
"windows": "Command Prompt"
},
"theme": "user",
"user_theme_colors": {
"foreground": "#b7b7e8"
},
}
Increase Sublime Text Sidebar Font Size
- Preferences
- Browse Package
- User
- Default.sublime-theme
Filename: Default.sublime-theme
[
{
"class": "sidebar_label",
"color": "orange",
"font.bold": false,
"font.size": 18
},
{
"class": "sidebar_tree",
"row_padding": [8, 3],
"row_padding": [8, 7],
"indent": 12,
"indent_offset": 17,
"indent_top_level": false,
"layer0.tint": [230, 230, 230],
"layer0.opacity": 0,
"dark_content": true
},
]