0

I've just noticed that when I call fc, I got the following error message:

zoltan@adrian ~ $ fc
bash: vi: command not found

The which command returns a similar result:

zoltan@adrian ~ $ which vi
which: no vi in (...intentional omission...)

The strange part of it is that I always just type "vi" when I use an editor. I've set up an alias in my .bashrc which will alias "vi" to "vim".

Could you provide an explanation why is this the case? Is it possible that these (built-in) commands open a subprocess with a non-bash shell, even if it is called from bash?

Is there any better workaround than putting a link named vi, which points to vim?

1
  • which doesn't know anything about shell aliases, functions, or builtins; use type instead. Commented Sep 6, 2022 at 18:00

1 Answer 1

1

You can put

export FCEDIT=vim

in your .bashrc to set the editor to vim instead of the default vi. This should take care of the error message and let you edit your commands.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .