Created
July 10, 2017 10:47
-
-
Save tenfyzhong/951d60f9520bc5982b85a51d6ed28a3c 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! s:to_qf() | |
redir => output | |
silent messages | |
redir END | |
let contents = split(output, '\n') | |
" echom 'contents: ' . output | |
" call setqflist(contents) | |
let qflist = [] | |
let bufnr = bufnr('%') | |
for c in contents | |
if c !~# 'E\d\+' | |
continue | |
endif | |
let item = {'bufnr': bufnr, 'lnum': 0, 'text': c} | |
call add(qflist, item) | |
endfor | |
let winnr = winnr() | |
call setloclist(winnr, qflist) | |
endfunction | |
command! ToQf call <SID>to_qf() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment