opening sublime text from windows git bash

后端 未结 11 2225
有刺的猬
有刺的猬 2021-01-30 09:15

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 fin

11条回答
  •  误落风尘
    2021-01-30 09:54

    I'm pretty new to this stuff and to git and sublime text. I'm taking the Udacity course on git right now, and was unable to get git bash to open sublime text.

    I kept getting bash: subl: C:/Program command not found

    or something like that

    I found my problem ended up being I had my slashes going the incorrect way, and I found if you have spaces in your file path, you have to add a slash everytime you have a space and it will fix the problem.

    I ended up typing

    echo 'alias subl="C:/Program\ Files/Sublime\ Text\ 3/subl.exe"' >> ~/.bashrc

    then subl

    and sublime text was opened.

    My original file path was-

    C:\Program Files\Sublime Text 3

    so make sure you have your slashes going the correct way, and if you have spaces in your file path, to add the necessary slash after a word.

    I'm on windows 10 using sublime text 3 and git bash

    Hopefully this saves someone else a lot of time.

提交回复
热议问题