What I'm looking for is a different window than the current one containing the output of a command into the same buffer. So I can execute:
:!php %
And see the output in a bottom split window. That's commonly seen in most graphical editors I've used.
Notes:
The flow would be:
without having hundreds of new buffers and having to switch between windows.
What I've tried so far that is not satisfactory ... sending output to file, turning autoread on, opening a buffer on that file. That works but I have to turn autoread on for all files.. a bit annoying. Is there a way to turn autoread for a single buffer/file?
Thanks for your help.
It sounds like you are looking for Vim's "quickfix" window. I'd use 'makeprg'
, :make
and :copen
, like this:
:set makeprg=php\ %
:make
:copen
Additionally, you can use the 'errorformat'
option to deliver the cursor to the first line containing an error.
:set errorformat=%m\ in\ %f\ on\ line\ %l
And for speed, I have F5 mapped to make
:
:nnoremap <F5> :<C-U>make<CR>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With