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.
相关问题
- How to Debug/Register a Permanent WMI Event Which
- the application was unable to start correctly 0xc0
- Why does recursive submodule update from github fa
- Extended message for commit via Visual Studio Code
- Windows 7: How can I get a list of all Windows use
相关文章
- 请教Git如何克隆本地库?
- GitHub:Enterprise post-receive hook
- Git Clone Fails: Server Certificate Verification F
- SSIS solution on GIT?
- Is there a version control system abstraction for
- ssh: Could not resolve hostname git: Name or servi
- Cannot commit changes with gitextensions
- git: retry if http request failed
A Better Solution:
The updated version of sublime text 3(Build 3065) brings this feature as "subl.exe" which was "subl" in mac os.
How to use:
step 1: Update sublime text (in sublimetext --> Help -> Check for Updates)
step 2: Just navigate to your project folder through bash and type subl.exe which should open the folder in sublime text. (if you encounter "subl.exe" command not found, just add sublime's path eg: "C:\Program Files\Sublime Text 3" to your system path - Here's how to add path to environment variables)
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: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
to open the current directory in Sublime Text or the name of the file as
to open it in Sublime Text. I also added other useful aliases in the
.bash_profile
file like:So in your git bash command prompt you can simply type
I hope this will help someone.
I added this to my C:\Users\username\.bashrc file:
Save the file. Then in Git Bash, type
to prove it works.
I had the same issue launching Sublime Text 3 form Git Bash.
I ran the following command (my OS was windows 7 and Sublime Text 3 was located in the "
C:\Program Files\Sublime Text 3
" directory) :echo 'alias subl="
/C/Program\ Files/Sublime\ Text\ 3/sublime_text.exe
"' >>~/.bashrc
Close Git Bash and Open it again.