How do I globally configure git to use a particular editor (e.g. vim) for commit messages?
How do I globally configure git to use a particular editor (e.g. vim )
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Setting the default editor for Git
Pick one:
Set
core.editorin your Git config:Set the
GIT_EDITORenvironment variable:Setting the default editor for all programs
Set the standardized
VISUALandEDITORenvironment variables*:NOTE: Setting both is not necessarily needed, but some programs may not use the more-correct
VISUAL. SeeVISUALvs.EDITOR.Fixing compatibility issues
Some editors require a
--waitflag, or they will open a blank page. For example:Sublime Text (if correctly set up; or use the full path to the executable in place of
subl):VS Code (after adding the shell command):