Created
March 7, 2011 19:38
-
-
Save davidmfoley/859064 to your computer and use it in GitHub Desktop.
VIM: populate quickfixes with any methods that flog >= 10.0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" 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