error list

12 views
Skip to first unread message

Joseph

unread,
May 22, 2020, 3:18:18 PM5/22/20
to vim...@googlegroups.com
Is there an easy way to dump the error list to the current vim buffer/window?

Actually, is there a general way to do this for other commands too?

So - I want to type something like ':clist/m 0' would be great

Yegappan Lakshmanan

unread,
May 22, 2020, 3:26:19 PM5/22/20
to vim...@googlegroups.com
Hi,

Are you looking for the following command?

   :call append(1, split(execute('clist'), "\n"))

or in insert mode, type the following:

   <C-R>=execute('clist')

and then hit Enter to insert the quickfix list contents.

- Yegappan 

Tony Mechelynck

unread,
May 22, 2020, 3:28:26 PM5/22/20
to vim_use
1. Open the quickfix window
:copen
2. Yank everything
:1,$y
3. Close the quickfix window
:cclose
4. Put, e.g.
:0put


Best regards,
Tony.

Lifepillar

unread,
May 22, 2020, 3:30:51 PM5/22/20
to vim...@googlegroups.com
On 2020-05-22, Joseph <kingca...@gmail.com> wrote:
> Is there an easy way to dump the error list to the current vim
> buffer/window?
>
> Actually, is there a general way to do this for other commands too?

I use this code, which you may adapt to your needs:

" Send the output of a Vim command to a new scratch buffer.
"
" Example: :call lf_run#vim_cmd('digraphs')
fun! lf_run#vim_cmd(cmd)
botright 10new
setlocal buftype=nofile bufhidden=wipe nobuflisted noswapfile nowrap
call append(0, split(execute(a:cmd), "\n"))
endf

" Execute a Vim command and send the output to a new scratch buffer
command! -complete=command -nargs=+ VimCmd call lf_run#vim_cmd(<q-args>)

So, try:

:VimCmd clist

Hope this helps,
Life.

Joseph

unread,
May 22, 2020, 4:04:47 PM5/22/20
to vim...@googlegroups.com
This is exactly what I was looking for. Thank you. The other response mentioning copen will be useful, too.

Some how, I don't think I have never used the execute command in something close to using vim for 20 years.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAAW7x7%3Dojr1PsPqOVRkGPVcLCtgcQ9ip56erjfb%2BjBq%3Dza0JiA%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages