Skip to content

Instantly share code, notes, and snippets.

@marcotrosi
Last active August 29, 2015 14:24
Show Gist options
  • Save marcotrosi/04d6d32cc7a6c5e56d8c to your computer and use it in GitHub Desktop.
Save marcotrosi/04d6d32cc7a6c5e56d8c to your computer and use it in GitHub Desktop.
Vim - create balloon message text out of lint messages
function! LintBalloon()
let BalloonText_l = []
" read lint output into a list
let LintOutput_l=readfile("project.lnt")
" iterate through list
for line in LintOutput_l
" find the message lines and capture the pure message (here for standard gcc format)
let Match_l = matchlist(line, '^' . expand('%:.') . ':' . v:beval_lnum .':\d\+: \(.*\)')
if len(Match_l) != 0 " if match
" add all matching lines to list
call add(BalloonText_l, Match_l[1])
endif
endfor
return join(BalloonText_l, "\n\n")
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment