Last active
February 11, 2017 20:32
-
-
Save bounceme/72aa91b4f2a473818d93384b7fff3bd4 to your computer and use it in GitHub Desktop.
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
function! g:FilterQf(ob) | |
let [cc,bnr] = [[],bufnr('%')] | |
let shm = &shortmess | |
set shortmess+=A | |
for i in a:ob | |
silent! exe 'hide keepalt keepjumps b ' . get(i,'bufnr') | |
let [ln,cl] = [get(i,'lnum'),get(i,'col')] | |
if synIDattr(synID(ln, cl ? cl : matchend(getline(ln),'^\s*\S'),0),'name') | |
\ !~? 'string\|regex\|comment' | |
call add(cc,deepcopy(i)) | |
endif | |
endfor | |
silent! exe 'keepalt keepjumps b ' . bnr | |
let &shm = shm | |
return cc | |
endfunction | |
command! QfSyn call setqflist(g:FilterQf(getqflist())) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment