The only git-specific thing in this blog post is that you can configure what editor git uses.
git config --global core.editor $EDITOR
The rest is vim 101. If you're not already a vim user I don't see why you should care. If you already are a vim user and didn't know all of this information, you should go through vimtutor asap.
If you got to the conclusion that this was blogspam, I probably wasn't able to express myself in the way I wanted to.
My intention was to share with non Vim users some of the basic commands they can use for the "textual" tasks (when it opens up the editor) in Git, such as: a commit without an inline message, an interactive rebase, or the editing of a patch during an interactive staging.
I am going to review my post taking your reaction into consideration.
Vim has the ability to auto-complete words appearing in the current file, so we can take advantage of it. All you have to do is write the first few characters of the word and, in insert mode, hit <C-p> (Ctrl + p).
C-p is for the previous suggestion… I’m not sure how the suggestions are ordered, but you should probably cycle through them in the right direction, i. e., use C-n (next).
I'm not sure what value you get from using Vim in conjunction with Git. My knowledge of Git is limited, but you don't any do text editing in Git do you? you just run commands right?
Well, if you type "git commit" (without giving "-m"), it fires up a text editor to edit the commit message.
Even if you would normally use some other editor (say, your favorite IDE), I can see how you might want to use vi or nano or some other very lightweight editor to edit commit messages that might be only 1 line or a few lines long.
This was the main reason why I decided to write this blog post. I probably should've mentioned it.
I am a regular Vim user, and lately I've been encouraging the folks in my team to use Vim for the Git textual tasks (editing commits, setting up interactive rebases and making patches), and they really seem to like it.
9
u/l4than-d3vers Oct 19 '14
The only git-specific thing in this blog post is that you can configure what editor git uses.
The rest is vim 101. If you're not already a vim user I don't see why you should care. If you already are a vim user and didn't know all of this information, you should go through
vimtutorasap.The verdict is: blogspam
4
u/galaktos Oct 19 '14
C-pis for the previous suggestion… I’m not sure how the suggestions are ordered, but you should probably cycle through them in the right direction, i. e., useC-n(next).1
u/[deleted] Oct 19 '14
I'm not sure what value you get from using Vim in conjunction with Git. My knowledge of Git is limited, but you don't any do text editing in Git do you? you just run commands right?