Introduction
It’s sometimes easier to edit a file from terminal by using Sublime Text, and yet it is not the default in Windows. This tutorial will show you how to use the command line to open files with Sublime Text in Windows.
Steps
Download the latest Sublime Text from here.
Append
subl.exe
to the systemPATH
environment. In my case, the path is atC:\Program Files\Sublime Text 3
. Therefore, open the terminal and type inset PATH=%PATH%;"C:\Program Files\Sublime Text 3"
.set
is a command that changes cmd’s environment variables only for the current cmd session. The%PATH%
part expands to the current value ofPATH
, and the path afterwards is then concatenated to it.Use in your terminal/console
subl
as a command to open whatever file. For example to openREADME.md
, just type insubl README.md
.
Conclusions
Sublime Text is a powerful text editor that is popular among programmers. To boost their productivity, all programmers should be aware of these tips.