1

I want to open files with Sublime text 3. Is there a way that I can permanently set Sublime text as the default editor in git bash?

I tried the following code:

alias 'subl= "/c/Program Files/Sublime Text 3/subl.exe"'

and it worked. But, when I closed the Git bash and reopen it later, the command subl didn't work and I had to type in the code again.

H.Jeong
  • 11
  • 2
  • 1
    You need to put the alias command in your `.bashrc` so that it persists between sessions. – OdatNurd May 30 '19 at 13:11
  • 1
    @OdatNurd thanks! I couldn't find .bashrc so I added alias subl="/c/Program\ Files/Sublime\ Text\ 3/sublime_text.exe" this code to my bash_profile and it works. – H.Jeong May 31 '19 at 13:00
  • Possible duplicate of [How can I make Sublime Text the default editor for Git?](https://stackoverflow.com/questions/8951275/how-can-i-make-sublime-text-the-default-editor-for-git) – Dinko Pehar Jun 03 '19 at 07:10
  • 1
    @DinkoPehar I tried those commands but they didn't work and still had the same problem of being reset every time I open the git bash. The comment above helped me and now it works. – H.Jeong Jun 04 '19 at 12:28

0 Answers0