You are not logged in.
Ok so I was taking a look at Environment variables topic and I want to set my default text editor to "VIM"
So if I add this line to my "~/.bash_profile" -
export EDITOR="${EDITOR}:/usr/bin/vim"it will suffice right ?
Because /usr/bin/vim is where is the executable is located as mentioned in the archwiki.
Last edited by RounakDutta (2022-06-04 16:28:14)
Offline
export EDITOR=vimshould suffice
EDIT: explanation: '/usr/bin/' is in your $PATH already
Check
echo $PATHLast edited by dogknowsnx (2022-06-03 11:17:45)
export EDITOR=vimshould suffice
EDIT: explanation: '/usr/bin/' is in your $PATH already
Checkecho $PATH
Oh ok that cleared my problem but why in the arch wiki it says
export PATH="${PATH}:/home/my_user/bin"Can you explain it to me ? What is "${PATH}:" here ? I am getting confused.
Last edited by RounakDutta (2022-06-03 12:07:24)
Offline
That's PATH, not EDITOR. Environment variables are just text strings and can be used for entirely different purposes by different software - so their content will not follow the same pattern.
PATH is used by the shell which interprets the content of the variable as a colon-separated list of directories / paths to search for executables. EDITOR is just used as is, it should not be a list of any sort.
The example of setting PATH that you quoted appends another directory to the existing list. It sets PATH to the current value of PATH, plus a colon, plus a new directory.
Last edited by Trilby (2022-06-03 12:10:29)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
That's PATH, not EDITOR. Environment variables are just text strings and can be used for entirely different purposes by different software - so their content will not follow the same pattern.
PATH is used by the shell which interprets the content of the variable as a colon-separated list of directories / paths to search for executables. EDITOR is just used as is, it should not be a list of any sort.The example of setting PATH that you quoted appends another directory to the existing list. It sets PATH to the current value of PATH, plus a colon, plus a new directory.
Oh ok. Thanks for clearing my doubt on PATH and EDITOR. Marking the post as solved.
Offline