How can I browse output of any random command in quickfix window?

akavel

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)

akavel

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.

edited at
0

Comments

0 comments
Login to comment

Related

how can i use any command for cut an command output

How can I format the command window output of a custom class in Matlab?

How can I hide the output of command line in terminal window?

PSQL: How can I prevent any output on the command line?

How can I output a list in random order?

How can I display output from a button command in a new window using tkinter?

How can I get the output of an ssh command?

How can i put command output into a variable

How can I format output of shell command

How can I pipe output into another command?

How can I get the output of the echo command?

How can i order the output of "echo" command

In vim, how do I choose which window to load a quickfix item?

How I can make a button for browse a folder?

How can I browse local project documentation

How can I redirect `time` output and command output to the same pipe?

How can I import output from a command as a command in Bash?

How can I read posts from any random channels in Telegram?

Any command by which i can go directly to the specify path via command line in window

How to redirect the output of any command?

How can I choose a random conversation output in Python?

How can I get any specific process window size?

How can I import a random number of arguments from command line?

how can i get my Netbeans output on a terminal window?

How can I output results to the 'result' window in JSFiddle?

How to find Chrome extensions that inject ads into any webpage I browse?

How can I open a Chrome window with exec.Command()?

How can I find the location (on the desktop) of a window on the command line?

How can I send a command to a CMD window in VB.NET

TOP Ranking

HotTag

Archive