VIM without configuration as the default editor for Git

Question:

I would like to use Vim as my default editor when making commits. But I have it loaded with a certain number of plugins (necessary) and it takes a second or two to launch it. Accordingly, in order to write a couple of lines in the commit message, you don't want to wait for VIM to load and start all plugins.

I know how to set the default editor in Git:

git config --global core.editor vim

You can start Vim without plugins like this:

vim -u NONE

Alas, the first thing that comes to mind: git config --global core.editor vim -u NONE doesn't work. What should be done?

Answer:

Option 1

Solution: we create our own script, which we register as an editor.

This can be done from the console like this:

sudo tee /usr/local/bin/bare-vim > /dev/null <<\EOF
!#/bin/sh
vim -u NONE "$@"
EOF

sudo chmod +x /usr/local/bin/bare-vim

git config --global core.editor bare-vim

Option 2

git config --global core.editor 'vim -u NONE'

this works too:

ps -aux | grep vim
...
/bin/sh -c vim -u NONE "$@" vim -u NONE 
Scroll to Top