Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Permanently set the default editor in Terminal

I have used this accepted answer to set my editor in Terminal. Unfortunately it only sets for a single session which means every time I reopen Terminal I have to set it again.

I would like to set it once and never have to do it again. Just so you are aware, I'm using GNU Nano.

Thanks!

like image 787
Eric Brotto Avatar asked Dec 13 '22 07:12

Eric Brotto


2 Answers

Put the command into your ~/.bashrc file.

like image 176
Michael Krelin - hacker Avatar answered Dec 27 '22 01:12

Michael Krelin - hacker


I think, and I will be swiftly and pedantically corrected if I am wrong, but; putting that in your ~/.profile will be executed by any shell, ~/.bash_profile will be executed by bash I generally only ever edit my .profile on Mac ,or my .bashrc on Linux...

From my understanding the difference between bashrc and bash_profile, is that the bashrc gets called for new interactive terminals or when you start bash... Even from bash, and bash_profile is called for login terminals...

like image 34
Grady Player Avatar answered Dec 27 '22 02:12

Grady Player