Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I can’t get Mercurial (hg) to use pico as my EDITOR when I’m using fish shell.

I’ve tried using this and other variations, but nothing seems to help:

set -U EDITOR pico

hg commit will always open vi as the editor, and I do not want that.

UPDATE: Adding setenv EDITOR pico to the file ~/.config/fish/config.fish did what I wanted.

share|improve this question
1  
Do you have VISUAL set? – grawity Jun 8 '12 at 9:02
2  
thanks! setenv worked for me too when trying to set $BUNDLER_EDITOR – Milovan Zogovic Sep 28 '12 at 13:22
2  
You should make your solution a proper answer and mark it as correct. – RazerM Oct 25 '13 at 17:53
    
Note that setenv is just a compatibility alias for set -gx. In the long wrong you'll be better off avoiding the use of such shims and doing things "the fish way"; e.g., set -gx EDITOR pico. – Kurtis Rader 2 days ago

This is the canonical way to do so

set -Ux EDITOR pico
  • U for universal variable
  • x to export it
share|improve this answer
    
pico is same as nano !!! – Ciasto piekarz Feb 15 '15 at 11:36

You can also set a default editor just for git, which will ignore your default setup:

git config --global core.editor pico
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.