Thursday, April 25, 2024
 Popular · Latest · Hot · Upcoming
149
rated 0 times [  149] [ 0]  / answers: 1 / hits: 240163  / 1 Year ago, sun, january 15, 2023, 9:55:00

I am trying to change the default editor from nano to vim.



I have run the following commands:



sudo update-alternatives --config editor



and



update-alternatives --config editor



Both now output:



  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


I have restarted my ssh session and restarted sshd but crontab -e still opens in nano



What else do I need to do?


More From » cron

 Answers
4

Try your ssh session followed by



export EDITOR=vim


or possibly



export EDITOR=/usr/bin/vim.basic


The format of setting of the EDITOR variable depends on which shell you are using.



In Ubuntu you can set the EDITOR environment variable on logon by adding the above to the ~/.profile



Your SSH session will read a similar file (if it exists) on the remote host called ~/.ssh/environment. This has to be specifically defined by the ssh daemon config. See man sshd_config and look for PermitUserEnvironment for more details.


[#44061] Sunday, January 15, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ightrushi

Total Points: 129
Total Questions: 125
Total Answers: 127

Location: French Southern and Antarctic Lands
Member since Fri, Jan 6, 2023
1 Year ago
;