I have vim as default editor on my Mac and every time I run commands on Mac terminal, it automatically opens "vim".
How can I set up "nano" instead and make sure the terminal will open "nano" every time is needed?
macintoshnanoosxterminalvim
I have vim as default editor on my Mac and every time I run commands on Mac terminal, it automatically opens "vim".
How can I set up "nano" instead and make sure the terminal will open "nano" every time is needed?
Best Answer
Set the
EDITOR
andVISUAL
environment variables tonano
.If you use
bash
on macOS, this is easiest done by editing your~/.bash_profile
file and adding the two linesto the bottom of the file. If the file does not exist, you may create it.
You should set both variables as some tools use one and others may use the other.
You will need to restart your terminal to have the changes take effect.