I'd like to run some $RANDOM_COMMAND
, and have the results opened in ("piped to") the quickfix window (:copen
/:cfile
). Is this possible, without having to define some commands in vimrc? (Hopefully in some "simple way", i.e. I'd like to be able to memorize this so I can run this on any new random box with vanilla vim that I'll have to login to.)
edit: initially didn't know how to express "simple way" more precisely, but now I know at least partially: I'd much prefer an answer of 1, max 2 lines.
edit2: tried something like below (from this and this):
:call setqflist(split(system('RANDOM_COMMAND'), '\n'))
:copen
but didn't seem to work anyway :/ (and mucho ugly too)
Hmh, found the simplest solution in the end, by reading through the regular vimdoc for quickfix window:
:cex system('$RANDOM_COMMAND') | copen
(the | copen
part is optional).
Still, Ingo Karkat's solution can have usability advantage, as on consecutive runs it's enough to run shorter :grep there.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments