From 1cab391bf9e3a8ebfe89598a50666156d7c8eae3 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 29 May 2017 14:42:49 +0100 Subject: Add keymap to load coverage results --- gvimrc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gvimrc b/gvimrc index eee67e1..09068aa 100644 --- a/gvimrc +++ b/gvimrc @@ -34,6 +34,7 @@ au FileType c,cpp,jam,h,slice map :wa:set makeprg=b2\ -qj3:mak au FileType c,cpp,jam,h,slice map :wa:set makeprg=b2\ -qj3\ pch=off:mak au FileType c,cpp,jam,h,slice map :wa:set makeprg=b2\ -qj3\ variant=release:mak au FileType c,cpp,jam,h,slice map :wa:set makeprg=b2\ -q:mak +au FileType c,cpp,h map :call LoadCov() au FileType dot map :wa:set makeprg=dot\ %\ -Tpng\ -O:mak au FileType cpp,h map :wa:set makeprg=doxygen:mak map :lnext @@ -53,6 +54,12 @@ set foldmethod=syntax set foldcolumn=4 set foldlevel=100 +function! LoadCov() + execute "!(cd /tmp && find ". expand("%:p:h") ." -name *.o -path */coverage/* | xargs gcov -r -p > /dev/null)" + let path = "/tmp/".substitute(@%, "/", "\\\\\\\#", "g").".gcov" + echo path + execute ":GcovLoad ".path +endfunction function! SvnDiffDir() let output = substitute(system('pwd | md5sum | cut -b-32'), "\n", "", "") let path = "/tmp/svndiff-".output.".patch" -- cgit v1.2.3