If you are already a vim and git master and you are impatient, please jump to theQuick start section at the end of this article.
1 Set up vimdiff
The vimdiff as a merge tool will display several buffers to show the yours/theirs/original changes.
The key point is to set up the vimdiff so that the buffer number in the vimdiff status line is visible.
First, add following code into your ~/.vimrc
set laststatus=2 "show the status line set statusline=%-10.3n "buffer number
Second, if you know the buffer number, you can use hot key like ",2" (press comma first, then press two as quickly as possible) to pull change from buffer number two.Add below code into your ~/.vimrc to set up hot keys:
map <silent> <leader>1 :diffget 1<CR> :diffupdate<CR> map <silent> <leader>2 :diffget 2<CR