diff options
author | Florian Pritz <bluewind@xinu.at> | 2012-06-10 14:11:42 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2012-06-10 14:11:42 +0200 |
commit | 20f3004c62addcf8224fcf6cfbc161b397ebe285 (patch) | |
tree | c40fc8e4add57a7d810a37c9a85cc78010ca0846 /.vimrc | |
parent | 9d5d53b221e859b91a28f5a5e456773683cd1bd7 (diff) | |
download | dotfiles-20f3004c62addcf8224fcf6cfbc161b397ebe285.tar.gz dotfiles-20f3004c62addcf8224fcf6cfbc161b397ebe285.tar.xz |
vimrc: add git BlameCurrentLine function
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to '.vimrc')
-rw-r--r-- | .vimrc | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -43,8 +43,6 @@ cnorea w!! w !sudo tee "%" > /dev/null "cnorea fb w !fb<CR> cnorea qpd %!perl -pe 's/\=([0-9A-Fa-f]{2})/chr(hex($1))/ge; s/\=\n//;' -let g:qname_hotkey = "<C-b>" - syntax on filetype plugin indent on @@ -127,6 +125,15 @@ au FileType tex map <F10> :!texi2pdf -c %<CR> "set tags+=$HOME/.vim/tags/python.ctags +" Get the commit responsible for the current line +nmap <c-b> :call BlameCurrentLine()<cr> +" Get the current line number & file name, view the git commit that inserted it +fun! BlameCurrentLine() +let lnum = line(".") +let file = @% +exec "!gitBlameFromLineNo " lnum file +endfun + map <F12> <ESC>ggg?G``" apply rot13 for people snooping over shoulder, good fun if !has("gui_running") |