Skip to content

Instantly share code, notes, and snippets.

@davidmfoley
Created March 7, 2011 19:38
Show Gist options
  • Save davidmfoley/859064 to your computer and use it in GitHub Desktop.
Save davidmfoley/859064 to your computer and use it in GitHub Desktop.
VIM: populate quickfixes with any methods that flog >= 10.0
" flog wrappers
function! FlogFile()
let current = fnamemodify(expand("%"), ':p')
call FlogAnalyze(current)
endfunction
function! FlogAll()
call FlogAnalyze('app lib -g')
endfunction
function! FlogAnalyze( path )
exec ":silent :!flog " . a:path . " | " . " awk '" . "length($1) > 4 && match($3, /[0-9\.]+/) {printf( \"\\%s:\\%s - flog score - \\%s \\n\", $3, $2,$1)}' > ~/.flog-results"
exec ':cfile ~/.flog-results'
endfunction
" matches the output above
set errorformat+=%f:%l:%m
" quickfix flog shortcuts
map <leader>fx :call FlogFile()<cr>
map <leader>fX :call FlogAll()<cr>
" navigate through error list
map <leader>cc :cc<CR>
map <leader>cn :cn<CR>
map <leader>cp :cp<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment