Change SVN message editor

Svn

Svn Problem Overview


So my co-worker felt it necessary to go onto my development box and do some code changes, then submit his work to subversion. I never set the commit message editor, and all of a sudden, one day I forgot to add the -m handle and apparently he set the default editor to emacs.

Being that I don't know the first thing about emacs and prefer vim myself, how do I go about changing the default editor for SVN commands to vim after it's already been set? I deleted the .subversion directory under the home directory, and it still prompts me.

Svn Solutions


Solution 1 - Svn

You can add corresponding setting in your $HOME/.subversion/config or %USERPROFILE%\Subversion\config. e.g. for my Windows VM I have got:

[helpers]
editor-cmd = c:/emacs-24.3/bin/runemacs.exe

Solution 2 - Svn

Update your SVN_EDITOR environment variable. You can try

echo $SVN_EDITOR

to see if this is set to something else in your shell - in which case you might want to take a look at your .bashrc (or similar) file.

Solution 3 - Svn

The editor to be used by SVN can be set at the Subversion config, as vvlevchenko suggested. Edit the corresponding setting in your %USERPROFILE%\Subversion\config on Windows respectively ~/.subversion/config on BSD, Linux, Mac OS.

To use Emacs with SVN on Windows:

[helpers]
editor-cmd = c:/emacs-24.3/bin/runemacs.exe

To use Nano with SVN on BSD, Linux or Mac OS:

[helpers]
editor-cmd = nano

Solution 4 - Svn

I also found this http://www.techchorus.net/how-set-svneditor-environment-variable-vim">here</a> (but changed from vim to gedit):

Command:

export SVN_EDITOR=gedit

To permanently set this environment variable, put the below line in your ~/.bash_profile file:

sudo gedit ~/.bash_profile
export SVN_EDITOR=gedit

(save file)

Solution 5 - Svn

vim ~/.bashrc

export SVN_EDITOR=vim   

source ~/.bashrc

Solution 6 - Svn

On Ubuntu, default editor for Subversion commit messages can be also changed by selecting default general command line text editor as described here: https://askubuntu.com/a/615181

sudo update-alternatives --config editor

  Selection    Path                Priority   Status
------------------------------------------------------------
* 0            /bin/nano            40        auto mode
  1            /bin/ed             -100       manual mode
  2            /bin/nano            40        manual mode
  3            /usr/bin/vim.basic   30        manual mode
  4            /usr/bin/vim.tiny    10        manual mode

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionScottView Question on Stackoverflow
Solution 1 - SvnvvlevchenkoView Answer on Stackoverflow
Solution 2 - SvnborribleView Answer on Stackoverflow
Solution 3 - SvnBengtView Answer on Stackoverflow
Solution 4 - SvnRyanView Answer on Stackoverflow
Solution 5 - SvnKunMing XieView Answer on Stackoverflow
Solution 6 - SvnChronosView Answer on Stackoverflow