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.84k stars 109 forks source link

Focus when invoking tail -f #217

Open aligit opened 3 years ago

aligit commented 3 years ago

Hello

I would like to start tailing a log file but I can't exist the quickfix anymore. I also tried the option -focus=0 but it still switches to that quickfix. How can I prevent switching to quickfix?

:AsyncRun -mode=term -pos=bottom -rows=5 tail -f /$HOME/payara5/glassfish/domains/domain1/logs/serv
er.log

Best Regards, Ali

aligit commented 3 years ago

Hello

I would like to start tailing a log file but I can't exist the quickfix anymore. I also tried the option -focus=0 but it still switches to that quickfix. How can I prevent switching to quickfix?

:AsyncRun -mode=term -pos=bottom -rows=5 tail -f /$HOME/payara5/glassfish/domains/domain1/logs/serv
er.log

Best Regards, Ali

The only way to get back to vim focus is to press ctrl-c(stop tailing process)

skywind3000 commented 3 years ago

When using -mode=term, the command will run in an internal terminal buffer, not quickfix window. <c-\><c-n> can be used to exit terminal mode and switch to terminal normal mode where you can switch window by <c-w>w.

For more information, please see: :h terminal.

For quickfix window, just watch your log by :

:AsyncRun tail -f  record.log

And stop watching by:

:AsyncStop