summaryrefslogtreecommitdiffstats
path: root/.vimrc
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2012-06-10 14:11:42 +0200
committerFlorian Pritz <bluewind@xinu.at>2012-06-10 14:11:42 +0200
commit20f3004c62addcf8224fcf6cfbc161b397ebe285 (patch)
treec40fc8e4add57a7d810a37c9a85cc78010ca0846 /.vimrc
parent9d5d53b221e859b91a28f5a5e456773683cd1bd7 (diff)
downloaddotfiles-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--.vimrc11
1 files changed, 9 insertions, 2 deletions
diff --git a/.vimrc b/.vimrc
index 058707b..7525fe0 100644
--- a/.vimrc
+++ b/.vimrc
@@ -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")