I know about % and #, which reference the filenames of the current and previous buffers in command-line mode. Is there any way to similarly reference other buffers?For example, let's say that :ls gives me:1 #h   foo.txt2  h   bar.txt3 %a   baz.txt...and I want to use a command to the effect of::!pandoc foo.txt bar.txt baz.txt -o out.pdfOnly with a bit less typing. I would imagine something along the lines of:!pandoc b1 b2 b3 -o out.pdfSo. Is there anything like this? Is there an addon somewhere, or some handy bit of vimscript I could use?
Can you reference buffers in command mode?
command line;buffers
You can do::!pandoc #1 #2 #3 -o out.pdfThis is mentioned briefly in the help at :h :_#n.If you need the full path to the file (say, because some of the files are in different directories), you can append :p like so::!pandoc #1:p #2:p #3:p -o out.pdf