From 4b2cdb5a7e8cda538f7ba95887bfe2b7c352dc66 Mon Sep 17 00:00:00 2001 From: Michiel Scholten Date: Wed, 20 Jan 2016 15:41:34 +0100 Subject: [PATCH] vim-fugitive for Git magic --- .vimrc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.vimrc b/.vimrc index c6ab2ed..ed0c664 100644 --- a/.vimrc +++ b/.vimrc @@ -32,6 +32,8 @@ Plugin 'bling/vim-airline' Plugin 'bling/vim-bufferline' " Version control notes in the line number bar Plugin 'mhinz/vim-signify' +" Git wrapper +Plugin 'tpope/vim-fugitive' " Think of sensible.vim as one step above 'nocompatible' mode: a universal " set of defaults that (hopefully) everyone can agree on. Plugin 'tpope/vim-sensible' @@ -261,7 +263,8 @@ nnoremap l :ls:b " Git and Mercurial 'blame' command. First select lines in visual modes, then " hit the appropriate leader key sequence (e.g., \g for git blame) -vmap g :!git blame =expand("%:p") \| sed -n =line("'<") ,=line("'>") p +" Update: For Git blame, just do :Gblame from vim-fugitive +"vmap g :!git blame =expand("%:p") \| sed -n =line("'<") ,=line("'>") p vmap h :!hg blame -fu =expand("%:p") \| sed -n =line("'<") ,=line("'>") p