Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.gitconfig not following bash alias for default editor command?

Tags:

In my .bash_profile, I have the vim command aliased to /Applications/MacVim.app/Contents/MacOS/Vim.

For the following line in my .gitconfig file,

 [core]
        editor = vim

git runs system vim rather than following the alias specified above. If I manually change it to match the complete path of MacVim's Vim command above, it works fine.

Is there any way to make .gitconfig follow the bash alias, rather than having to set the complete MacVim path? (I have all my user config files synchronized across multiple machines, some of which don't run MacVim.)

like image 344
Ryan Lue Avatar asked May 26 '16 16:05

Ryan Lue


1 Answers

Aliases are shortcuts for an interactive shell; they are not used by other processes. Just specify the exact path you want in .gitconfig; you only have to type it once.

like image 50
chepner Avatar answered Oct 06 '22 02:10

chepner