How do I make git use the editor of my choice for editing commit messages?

Setting the default editor for Git Pick one: Set core.editor in your Git config: git config –global core.editor “vim” Set the GIT_EDITOR environment variable: export GIT_EDITOR=vim Setting the default editor for all programs Set the standardized VISUAL and EDITOR environment variables*: export VISUAL=vim export EDITOR=”$VISUAL” NOTE: Setting both is not necessarily needed, but some programs … Read more

Turning off auto indent when pasting text into vim

Update: Better answer here: https://stackoverflow.com/a/38258720/62202 To turn off autoindent when you paste code, there’s a special “paste” mode. Type :set paste Then paste your code. Note that the text in the tooltip now says — INSERT (paste) –. After you pasted your code, turn off the paste-mode, so that auto-indenting when you type works correctly … Read more

How can I make Sublime Text the default editor for Git?

Windows Sublime Text 2 (Build 2181) The latest Build 2181 just added support for the -w (wait) command line argument. The following configuration will allow ST2 to work as your default git editor on Windows. This will allow git to open ST2 for commit messages and such. git config –global core.editor “‘c:/program files/sublime text 2/sublime_text.exe’ … Read more

Using Vim’s tabs like buffers

Stop, stop, stop. This is not how Vim’s tabs are designed to be used. In fact, they’re misnamed. A better name would be “viewport” or “layout”, because that’s what a tab is—it’s a different layout of windows of all of your existing buffers. Trying to beat Vim into 1 tab == 1 buffer is an … Read more

How can I set up an editor to work with Git on Windows?

Update September 2015 (6 years later) The last release of git-for-Windows (2.5.3) now includes: By configuring git config core.editor notepad, users can now use notepad.exe as their default editor. Configuring git config format.commitMessageColumns 72 will be picked up by the notepad wrapper and line-wrap the commit message after the user edits it. See commit 69b301b … Read more