How to quickly open Sublime Text using the command prompt (cmd) or terminal in Windows

السلام عليكم و رحمة الله وبركاته
Peace, Mercy, and Blessings of Allah be upon you

Actually, Coding is the Profession of a Web developer But as a digital marketer, you have to learn some coding like HTML, CSS, JAVASCRIPT. so in this article, I will be talking about Sublime Text it’s the most popular text editor for coding. And this article will be getting complete guidelines of Sublime Text.

So what’s going on guys, this is Alamin from alaminthebest.com. And this is a very short tutorial, in which I will be showing you how you can open Sublime Text using the command prompt that you have in Windows. This is specifically for those users who are actually using the Windows operating system. And they want to open the Sublime Text Editor inside the machine using the command prompt.

You can do this in two ways First is you just create user variables and the second is you create user variables & system variables, My suggestion is you should follow the second way.

You can learn the first way to follow the video below

So let’s jump right into this and I’ll be showing you how you can open it using the command prompt. So first of all, you need to create an environment variable for Sublime Text so that you can use a command to trigger this and the command prompt will be opening Sublime Text using that command.

So first of all, what you will do, you will just have to search for the environment variable setup option. So as you can see, this is an option that is provided by Windows to set up your own environment variables or to manage the summary tables that you have. So just click on that to open it and then just the provide into this environment variable session.

Okay, then here, you need to create one system variable for the sublime text. So just click on the name button. Now just give it a name something like sublime, okay, and this variable’s value will be pointing to the part where the Sublime Text is actually installed in your machine.

How to open sublime text using CMD
How to Open Sublime using CMD

So in usual cases, it will be your C drive, okay, and C right, you can just head over to this Program Files folder. Inside that we’ll be finding out something like sublime text string, so I’ve installed Sublime Text suite, so it is destroying this bone over here. So just click on this folder. Now copy this path here as the value. Now just click on OK. As you can see, this new variable has been created over here.

Okay, now what it will do, you just go to the PATH variable, this is our PATH variable, just click on Edit. Okay, now add one more entry for this. And this entry will be called as %sublime%. This click on OK. Okay, and then you’re done with the system partner even now go to the user PATH variable, click on Edit. Now here also we will be doing the same thing. We’ll create one more entry for %Sublime%. Okay, now what this will do this will tell the command from that as one more value for some lamp tax so that you can open it using the command. Okay, now the system and we are done with the environment variable setup. Now just click on the OK to save it. Click on OK again.

Now you can just simply open the command prompt. Just remember one thing if you are already open command prompt and then you’re setting up the environment variable. Just close this and try to open it again because the environment variable will be taking effect after you close the current command prompt window and open it back. Okay, so just remember that thing. Now as you can see, I already opened this command prompt. So once again, after setting up an Environment variable.

So now I can just type in my command which is actually has to be a URL. And then you can see it’s open. Okay, so this is how you can use this SQL command to open any file inside Sublime Text. Now, right now I had already opened this file inside my Sublime Text. So it got open with this file only. So now let me just close the Sublime Text window. And now let me try to hit the command once again. And it’s open again. So you can see using this command, we can actually open Sublime Text, okay.

Now, if you want to create a new file, and at the same time you want to open Sublime Text, what you need to do to type this as we will come on and then after that, you need to type the file name. For example, if my files name will be, say text or HTML. So I get this, type that right here. And then again, this hit enter. So as you can see, this one from the command prompt will be opening Sublime Text using this in this file. So now this file will be there by default on my Sublime Text window. So this is how you can open a file using the command prompt inside Sublime Text.

Now, there will be cases in which you want to import or open that entire project folder on which you’re working inside Sublime Text in the command prompt. So how will you do that? So for doing that, what we’ll do is pretty simple, just head over to the command prompt once again, and just route to this folder, whatever portfolio you have. In my case, this is supported in which I have my current folder. So as you can see, I have two folders here, and in which the first folder that is actually Indian to do that’s actually my import folder,

which I want to open. So I’ve been doing the same thing again, I’ll be describing this as Sybil command, and then I’ll be given a space and just like the previous case when we type the name of the file for opening it by typing the name of my bullet folder over here, this time So that I can open it. So this is how you do the command to open a folder inside Sublime Text now you can just simply hit Enter, and Holy smokes, this is actually open.

Okay, so you might be noticing one more thing that this has actually opened one more Sublime Text window, although I had one more window open already. Okay, so in case if you want to open a new file or new folder inside the existing or inside this already open Sublime Text window, what you need to do, just hit this command with one more option called at the if you provide this option, this is an additional option, which you need to provide in order to open whatever you’re trying to open inside the sense of like window on the screen,

so if you put the same command and with this option as well along with that command, and it will be opening the folder or the file which are going to open inside the same Sublime Text window. So now this time, let’s see what happens. Okay, now you can see that it had got open inside the same Sublime Text window instead of opening it inside one more window, or one stance of the same Sublime Text.

So this is pretty much how you can use Command Prompt in Windows to open any file or any project folder in Sublime Text and work with it. And yeah, that’s it. It’s pretty simple to use and a small hack that you can use to get it to work.

Okay, so if you have any doubts, just let me know in the comment section below. And if you like this video, then just don’t forget to hit the like button and also click on the subscribe button to subscribe to my channel to get more videos like this. So I’ll see you guys in some other videos. Peace out

Thanks for looking my video and article