2

I would like to change or add the ability to open files when working with mingw32 with a different text editor ( in my case sublime text 2 ) I have been googling around but I'm not sure i understand how to do this.

I would like to be able to do the following from the command line:

$ st textfile.text -- where st is a command to use st2 to open the textfile.

you can already do this with vim

I'd appreciate any pointers.

thanks in advance

2 Answers 2

4

You have to set the EDITOR enviroment variable. Set it for a single shell instance with:

export EDITOR=<path to your editor>

Or add that to .bashrc to set it automatically for all new shell instances.

1
  • does mingw32 have a .bashrc file? I have been unable to find it Feb 23, 2013 at 0:38
1

If the sublime text 2 application is named st.exe, add the directory where it is to PATH. Doing it only for mingw32 should be possible with adding it in your .bashrc like:

export PATH=$PATH:<msyspath-to-st-directory>

But you could aswell add it to Environment variables in Windows to make it work in cmd.exe aswell.

2
  • does mingw32 have a .bashrc file? I have been unable to find it. Feb 23, 2013 at 0:37
  • not by default (probably), but you can create one.. if so it should be wherever your HOME directory is. But I suggest you change PATH in Windows Environment variables instead. Feb 24, 2013 at 14:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .