Sunday, May 19, 2024
11
rated 0 times [  11] [ 0]  / answers: 1 / hits: 53681  / 1 Year ago, thu, december 15, 2022, 2:44:44

While reading the git introductory material, I read a piece that brought this question to mind.



How do I use the Terminal to find out what my Default Text Editor is?



Are there a General Commands that I can use to find this out?


More From » command-line

 Answers
6

The default editor is as defined by the EDITOR, or VISUAL, environment variable(s).



The default editor is vi if neither were defined. Add



export EDITOR="/bin/nano" 


to your ~/.bashrc file to set, for example, nano as your default editor.



To see if the environment variable is set, you can use



printenv | grep EDITOR


or



set | grep EDITOR


One can dereference the value of the named environment variable by prefixing it with a "$"



$ echo $EDITOR


or



$ echo $VISUAL

[#17244] Friday, December 16, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
polcomposte

Total Points: 421
Total Questions: 92
Total Answers: 109

Location: Uzbekistan
Member since Mon, Jul 20, 2020
4 Years ago
polcomposte questions
Wed, Dec 14, 22, 02:45, 1 Year ago
Sat, Apr 9, 22, 01:36, 2 Years ago
Mon, Dec 26, 22, 01:52, 1 Year ago
Fri, May 20, 22, 12:03, 2 Years ago
;