I use Vim a lot, and I know how I can start vim in insert mode. So I have an alias named vii
in my .bash_aliases
file.
On other hand I use Git a lot too, and I have this line in my .gitconfig
:
[core]
editor = vi
To write a commit message the vi editor is opened every time and I have to go in insert mode. So I thought of replacing vi
with vii
, and did.
But the problem is when I do git commit
, instead of opening the vim in insert mode, it gives this error:
error: cannot run vii: No such file or directory
error: There was a problem with the editor 'vii'.
Please supply the message using either -m or -F option.
This makes clear that git does not looks to .bash_aliases
file, even it isn't related to bash in any way. It does directly looks if there is /usr/bin/vii
or not. And executes it if it is.
The Question
Can I place the aliased version of vi as vii
in /usr/bin/
?
(and please don't suggest me to use git commit -m "<commit message>"
. There are other situation where I need vim in insert mode.)