Change default SVN Editor on Mac OS X

Okay, I admit it. I do prefer a graphical user interface over a the Terminal app. But some things are more efficient to do on the command line. For example commiting changes in a subversion repository. So, instead of using the ‘-m “some text”‘ parameter or get stuck in emacs/vi, you could simply change to default svn editor to let’s say TextEdit (the per default Mac OS X text editor). To do so, go to your .profile or in my case .zshrc (I’m using zsh) file which is located in your home directory and add the following line:

  • export EDITOR=”/usr/bin/open -n -W -a /Applications/TextEdit.app”

The options will send the content from the svn temporary file to TextEdit, tell “open” to stay open as long as TextEdit is open (“-W”), “-a” for selecting TextEdit (you can choose TextWrangler or anything else as well) and to open a new instance of the editor (“n”), in case you already opened it. But don’t forget: to finish the commiting process you need to quit TextEdit and you do need to restart Terminal in order to “reread” your configuration file.

Advertisements

6 Comments

Filed under Mac OS X Software, SVN

6 responses to “Change default SVN Editor on Mac OS X

  1. Pingback: 2010 in review | neverbeenbetter

  2. Jefferson

    Nice tip. You don’t need to restart Terminal though, you can use the following command to re-read the configuration file:

    source ~/.profile

  3. Rat

    This is exactly what I want to know, but when I put it in, I get:
    -bash: export: `-n’: not a valid identifier
    -bash: export: `-W’: not a valid identifier
    -bash: export: `-a’: not a valid identifier
    -bash: export: `/Applications/TextEdit.app”’: not a valid identifier
    s-mac-pro:~ Mac1$
    What am I doing wrong?

    • CellJeffe

      The code above is using a funky unicode close-quotation character (”). Retype the line using the standard double-quote character (“) instead of cutting/pasting the above export EDITOR=… line into your .profile.

      • Coxy

        The .profile entry also works with single quotes which might be clearer:

        export EDITOR=’/usr/bin/open -n -W -a /Applications/TextEdit.app’

  4. thanks for the info! I retyped the command and verified on my command line. It should work now!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s