I'm looking for a way to write content of a quickfix window to a file with a specific formatting, preferably in a way that is easily scriptable.
What I'm trying to achieve is a very light integration of Vim and ipdb:
nmap <leader>s :call setqflist([], 'a', {'items': [{'filename': @%, 'lnum':line('.'), 'text':'break'}]})
.pdbrc
file with break file_path:line_number
formattingYou have two problems:
Turning items
into a list of properly formatted lines.
You will need to:
:help getqflist()
,:help map()
,file_path
from the bufnr
field with :help bufname()
and possibly :help fnamemodify()
.Writing that list to a given file.
You will need :help writefile()
.