You are not logged in.

#1 2022-06-03 11:04:33

RounakDutta
Member
From: West Bengal, India
Registered: 2022-02-11
Posts: 192
Website

[SOLVED] [Quick question] How to set vim as default text editor ?

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

#2 2022-06-03 11:12:28

dogknowsnx
Guest

Re: [SOLVED] [Quick question] How to set vim as default text editor ?

export EDITOR=vim

should suffice
EDIT: explanation: '/usr/bin/' is in your $PATH already
Check

echo $PATH

Last edited by dogknowsnx (2022-06-03 11:17:45)

#3 2022-06-03 12:04:27

RounakDutta
Member
From: West Bengal, India
Registered: 2022-02-11
Posts: 192
Website

Re: [SOLVED] [Quick question] How to set vim as default text editor ?

dogknowsnx wrote:
export EDITOR=vim

should suffice
EDIT: explanation: '/usr/bin/' is in your $PATH already
Check

echo $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

#4 2022-06-03 12:08:29

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,456
Website

Re: [SOLVED] [Quick question] How to set vim as default text editor ?

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

#5 2022-06-04 16:27:59

RounakDutta
Member
From: West Bengal, India
Registered: 2022-02-11
Posts: 192
Website

Re: [SOLVED] [Quick question] How to set vim as default text editor ?

Trilby wrote:

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

Board footer

Powered by FluxBB