How do I open Sublime text from Git Bash in Windows? I tried adding the alias at the ~/.bashrc file but nothing worked. I was looking for something very easy but I could not find in the internet.
Type 'Terminus' and select it. Wait for it to Complete installation and Restart sublime text. And save it. Note: The above code is for Linux users for Windows users you have to enter “cmd.exe” in place of “bash”, also here we kept the shortcut key as “alt+1” you can use your own key.
Step 1: Open the downloaded .exe file from the downloads folder and begin with the installation process. Step 3: If you want Sublime Text 3 to appear in your right-click menu, then mark the checkbox and click on the Next button. Step 4: Press the install button. Step 5: Finish with the installation process.
I am going to answer my own question. First, I created a .bash_profile
file under /Users/username directory. I have copied all my git aliases here. To access sublime text I added this alias:
alias subl="/c/Program\ Files/Sublime\ Text\ 2/sublime_text.exe"
I think the spaces after the backward slashes are important for formatting. If this doesn't work you will have to look where your sublime_text.exe file situated at and put the path after formatting as above. Now in the git bash command line just type
subl .
to open the current directory in Sublime Text or the name of the file as
subl readme.md
to open it in Sublime Text. I also added other useful aliases in the .bash_profile
file like:
alias gc="git commit -m" alias ga="git add ." alias gl="git log" alias gs="git status"
So in your git bash command prompt you can simply type
gs ##for git status gl ##for git log, etc
I hope this will help someone.
Create .bash_profile
file under C:\Users\YourUserName\
and add the following line in the file:
alias 'subl="/c/Program Files/Sublime Text 3/subl.exe"'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With