21

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.

Giacomo1968
  • 53,069
  • 19
  • 162
  • 212
Petteri Kamppuri
  • 311
  • 1
  • 2
  • 5

3 Answers3

31

This is the canonical way to do so

set -Ux EDITOR pico
  • U for universal variable
  • x to export it
Peter R
  • 411
  • 4
  • 5
11

This FAQ suggests adding set -gx EDITOR pico to ~/.config/fish/config.fish

Marco Maldonado
  • 211
  • 2
  • 2
7

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

git config --global core.editor pico
Berislav Lopac
  • 171
  • 1
  • 3