Skip to content

Instantly share code, notes, and snippets.

@radamant
Forked from davidmfoley/gist:859064
Created March 7, 2011 19:50
Show Gist options
  • Save radamant/859088 to your computer and use it in GitHub Desktop.
Save radamant/859088 to your computer and use it in GitHub Desktop.
" 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>
@radamant
Copy link
Author

radamant commented Mar 7, 2011

Doesn't output command in command-bar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment