skywind3000 / asyncrun.vim

:rocket: Run Async Shell Commands in Vim 8.0 / NeoVim and Output to the Quickfix Window !!
https://www.vim.org/scripts/script.php?script_id=5431
MIT License
1.86k stars 111 forks source link

Is there an option to remove "||" in the quickfix output? #228

Open zoumi opened 3 years ago

zoumi commented 3 years ago

asyncrun.vim will output something like this

|| [xxxxxx]
...
...
|| Hello, world!
|| [Finished in 2 seconds]

I need copy the output of my cmd. Can I tell asyncrun.vim to not add "||" at the begin of line? (I need error format be captured, so I can't use "-raw" option)

jobo3208 commented 2 years ago

FWIW, it looks like Vim itself adds the "||" to the quickfix contents when displaying them. You can verify this by inspecting the list returned from getqflist() -- the quickfix entries themselves do not contain the leading "||".

I searched around for a way to modify the way Vim displays the quickfix list, but it doesn't appear to be configurable. Your best (only?) bet may be to use an autocommand to temporarily make the quickfix buffer modifiable, and then to do a substitution to remove the leading pipes. At that point, though, you may begin to wonder (as I did) if the quickfix buffer is really the right tool for the job...

skywind3000 commented 2 years ago

try this:

:AsyncRun -mode=term -pos=TAB  ls -la
jobo3208 commented 2 years ago

Thanks! I didn't even think of using the built-in terminal. (I don't have much experience with it.) This indeed gets rid of the leading pipes, and feels like the more appropriate tool for my particular use case.

aemonge commented 2 years ago

But that makes the qf not to update :(

skywind3000 commented 2 years ago

"||" is a part of quickfix window, you can copy content from quickfix and remove the first 2 columns.