Skip to content

Commit 74be5b5

Browse files
committed
update doc
1 parent 6f3470c commit 74be5b5

File tree

1 file changed

+51
-50
lines changed

1 file changed

+51
-50
lines changed

doc/asyncrun.txt

Lines changed: 51 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ There can be some options before your '[cmd]':
256256
modified files before executing.
257257

258258
- '-program=?': set to 'make' to use '&makeprg', 'grep' to use '&grepprt' and
259-
'wsl' to execute commands in WSL (windows 10), see command modifiers [6].
259+
'wsl' to execute commands in WSL (windows 10), see command modifiers.
260260

261261
- '-post=?': vimscript to exec after job finished, spaces **must** be escaped
262262
to '\ '
@@ -272,7 +272,7 @@ There can be some options before your '[cmd]':
272272
- '-pos=?': When using internal terminal with '-mode=term', '-pos' is used to
273273
specify where to split the terminal window, it can be one of '"tab"',
274274
'"curwin"', '"top"', '"bottom"', '"left"', '"right"' and '"external"'. And
275-
you can customize new runners [7] and pass runner's name to '-pos' option.
275+
you can customize new runners and pass runner's name to '-pos' option.
276276

277277
- '-rows=num': When using a horizontal split terminal, this value represents
278278
the height of terminal window.
@@ -329,12 +329,12 @@ Settings ~
329329

330330
- g:asyncrun_exit - script will be executed after finished.
331331
- g:asyncrun_bell - non-zero to ring a bell after finished.
332-
- g:asyncrun_mode - specify how to run your command, see here [8].
332+
- g:asyncrun_mode - specify how to run your command, see here [6].
333333
- g:asyncrun_encs - set shell encoding if it's different from '&encoding',
334-
see encoding [9].
334+
see encoding [7].
335335
- g:asyncrun_trim - non-zero to trim the empty lines in the quickfix window.
336336
- g:asyncrun_auto - event name to trigger QuickFixCmdPre/QuickFixCmdPost, see
337-
FAQ [10].
337+
FAQ [8].
338338
- g:asyncrun_open - above zero to open quickfix window at given height after
339339
command starts.
340340
- g:asyncrun_save - non-zero to save current(1) or all(2) modified buffer(s)
@@ -344,7 +344,7 @@ Settings ~
344344
- g:asyncrun_wrapper - enable to setup a command prefix.
345345
- g:asyncrun_stdin - non-zero to enable stdin (useful for cmake on windows).
346346

347-
For more information of above options, please visit **option details [11]**.
347+
For more information of above options, please visit **option details [9]**.
348348

349349
-------------------------------------------------------------------------------
350350
*asyncrun-variables*
@@ -406,7 +406,7 @@ command:
406406
- 'bang': same as '!'
407407
- 'term': open a reusable internal terminal window and run your command
408408

409-
For more information, please see here [8].
409+
For more information, please see here [6].
410410

411411
-------------------------------------------------------------------------------
412412
*asyncrun-internal-terminal*
@@ -492,19 +492,22 @@ Customize Runner ~
492492
You may want your command run in a tmux split or a new gnome-terminal window,
493493
for this reason, AsyncRun allows you create new runners:
494494
>
495-
function! s:my_runner(command)
496-
echo "run: " . a:command
495+
function! MyRunner(opts)
496+
echo "command to run is: " . a:opts.cmd
497497
endfunction
498498
499499
let g:asyncrun_runner = get(g:, 'asyncrun_runner', {})
500-
let g:asyncrun_runner.test = { cmd -> s:my_runner(cmd) }
500+
let g:asyncrun_runner.test = function('MyRunner')
501501
<
502502
Then try:
503503
>
504504
:AsyncRun -mode=term -pos=test ls -la $(VIM_FILEDIR)
505505
<
506506
When '-mode' is 'term' and '-pos' can used to represent runner name.
507507

508+
Runner function has only one argument: 'opts', it contains the options
509+
extracted from ':AsyncRun' command line, and 'opts.cmd' stores current command.
510+
508511
-------------------------------------------------------------------------------
509512
*asyncrun-command-modifier*
510513
Command Modifier ~
@@ -542,52 +545,52 @@ Recommend to use Vim 8.0 or later.
542545
*asyncrun-cooperate-with-vim-fugitive*
543546
Cooperate with vim-fugitive: ~
544547

545-
asyncrun.vim can cooperate with 'vim-fugitive', see here [12].
548+
asyncrun.vim can cooperate with 'vim-fugitive', see here [10].
546549

547-
Image: (see reference [13])
550+
Image: (see reference [11])
548551

549552
-------------------------------------------------------------------------------
550553
*asyncrun-language-tips*
551554
Language Tips ~
552555

553-
- Better way for C/C++ developing with AsyncRun [14]
556+
- Better way for C/C++ developing with AsyncRun [12]
554557

555558
-------------------------------------------------------------------------------
556559
*asyncrun-more-topics*
557560
More Topics ~
558561

559-
- Additional examples (background ctags updating, pdf conversion, ...) [15]
560-
- Notify user job finished by playing a sound [16]
561-
- View progress in status line or vim airline [17]
562-
- Best practice with quickfix window [18]
563-
- Scroll the quickfix window only if the cursor is on the last line [19]
564-
- Replace old ':make' command with asyncrun [20]
565-
- Quickfix encoding problem when using Chinese or Japanese [9]
566-
- Example for updating and adding cscope files [21]
562+
- Additional examples (background ctags updating, pdf conversion, ...) [13]
563+
- Notify user job finished by playing a sound [14]
564+
- View progress in status line or vim airline [15]
565+
- Best practice with quickfix window [16]
566+
- Scroll the quickfix window only if the cursor is on the last line [17]
567+
- Replace old ':make' command with asyncrun [18]
568+
- Quickfix encoding problem when using Chinese or Japanese [7]
569+
- Example for updating and adding cscope files [19]
567570
- The project root directory of the current file [5]
568-
- Specify how to run your command [8]
571+
- Specify how to run your command [6]
569572

570-
Don't forget to read the Frequently Asked Questions [22].
573+
Don't forget to read the Frequently Asked Questions [20].
571574

572575
-------------------------------------------------------------------------------
573576
*asyncrun-cooperate-with-other-plugins*
574577
Cooperate with other Plugins ~
575578

576-
- vim-fugitive [12]: perfect cooperation, asyncrun gets Gfetch/Gpush running
579+
- vim-fugitive [10]: perfect cooperation, asyncrun gets Gfetch/Gpush running
577580
in background
578581

579-
- errormarker [23]: perfect cooperation, errormarker will display the signs
582+
- errormarker [21]: perfect cooperation, errormarker will display the signs
580583
on the error or warning lines
581584

582-
- airline [24]: very well, airline will display status of background jobs
585+
- airline [22]: very well, airline will display status of background jobs
583586

584-
- sprint [25]: nice plugin who uses asyncrun to provide an IDE's run button
587+
- sprint [23]: nice plugin who uses asyncrun to provide an IDE's run button
585588
to runs your code
586589

587-
- netrw [26]: netrw can save remote files on background now. Experimental,
590+
- netrw [24]: netrw can save remote files on background now. Experimental,
588591
take your own risk
589592

590-
See: Cooperate with famous plugins [23]
593+
See: Cooperate with famous plugins [21]
591594

592595
-------------------------------------------------------------------------------
593596
*asyncrun-credits*
@@ -608,26 +611,24 @@ References ~
608611
[3] doc/screenshot.gif
609612
[4] https://github.com/skywind3000/asyncrun.vim/wiki/FAQ#cant-see-the-realtime-output-when-running-a-python-script
610613
[5] https://github.com/skywind3000/asyncrun.vim/wiki/Project-Root
611-
[6] https://github.com/skywind3000/asyncrun.vim/wiki/Command-Modifier
612-
[7] https://github.com/skywind3000/asyncrun.vim/wiki/Customize-Runner
613-
[8] https://github.com/skywind3000/asyncrun.vim/wiki/Specify-how-to-run-your-command
614-
[9] https://github.com/skywind3000/asyncrun.vim/wiki/Quickfix-encoding-problem-when-using-Chinese-or-Japanese
615-
[10] https://github.com/skywind3000/asyncrun.vim/wiki/FAQ#can-asyncrunvim-trigger-an-autocommand-quickfixcmdpost-to-get-some-plugin-like-errormaker-processing-the-content-in-quickfix-
616-
[11] https://github.com/skywind3000/asyncrun.vim/wiki/Options
617-
[12] https://github.com/skywind3000/asyncrun.vim/wiki/Cooperate-with-famous-plugins#fugitive
618-
[13] https://rg.gosu.cc/skywind3000/asyncrun.vim/master/doc/cooperate_with_fugitive.gif
619-
[14] https://github.com/skywind3000/asyncrun.vim/wiki/Better-way-for-C-and-Cpp-development-in-Vim-8
620-
[15] https://github.com/skywind3000/asyncrun.vim/wiki/Additional-Examples
621-
[16] https://github.com/skywind3000/asyncrun.vim/wiki/Playing-Sound
622-
[17] https://github.com/skywind3000/asyncrun.vim/wiki/Display-Progress-in-Status-Line-or-Airline
623-
[18] https://github.com/skywind3000/asyncrun.vim/wiki/Quickfix-Best-Practice
624-
[19] https://github.com/skywind3000/asyncrun.vim/wiki/Scroll-the-quickfix-window-only-if-cursor-is-on-the-last-line
625-
[20] https://github.com/skywind3000/asyncrun.vim/wiki/Replace-old-make-command-with-AsyncRun
626-
[21] https://github.com/skywind3000/asyncrun.vim/wiki/Example-for-updating-and-adding-cscope
627-
[22] https://github.com/skywind3000/asyncrun.vim/wiki/FAQ
628-
[23] https://github.com/skywind3000/asyncrun.vim/wiki/Cooperate-with-famous-plugins
629-
[24] https://github.com/skywind3000/asyncrun.vim/wiki/Cooperate-with-famous-plugins#vim-airline
630-
[25] https://github.com/pedsm/sprint
631-
[26] https://github.com/skywind3000/asyncrun.vim/wiki/Get-netrw-using-asyncrun-to-save-remote-files
614+
[6] https://github.com/skywind3000/asyncrun.vim/wiki/Specify-how-to-run-your-command
615+
[7] https://github.com/skywind3000/asyncrun.vim/wiki/Quickfix-encoding-problem-when-using-Chinese-or-Japanese
616+
[8] https://github.com/skywind3000/asyncrun.vim/wiki/FAQ#can-asyncrunvim-trigger-an-autocommand-quickfixcmdpost-to-get-some-plugin-like-errormaker-processing-the-content-in-quickfix-
617+
[9] https://github.com/skywind3000/asyncrun.vim/wiki/Options
618+
[10] https://github.com/skywind3000/asyncrun.vim/wiki/Cooperate-with-famous-plugins#fugitive
619+
[11] https://rg.gosu.cc/skywind3000/asyncrun.vim/master/doc/cooperate_with_fugitive.gif
620+
[12] https://github.com/skywind3000/asyncrun.vim/wiki/Better-way-for-C-and-Cpp-development-in-Vim-8
621+
[13] https://github.com/skywind3000/asyncrun.vim/wiki/Additional-Examples
622+
[14] https://github.com/skywind3000/asyncrun.vim/wiki/Playing-Sound
623+
[15] https://github.com/skywind3000/asyncrun.vim/wiki/Display-Progress-in-Status-Line-or-Airline
624+
[16] https://github.com/skywind3000/asyncrun.vim/wiki/Quickfix-Best-Practice
625+
[17] https://github.com/skywind3000/asyncrun.vim/wiki/Scroll-the-quickfix-window-only-if-cursor-is-on-the-last-line
626+
[18] https://github.com/skywind3000/asyncrun.vim/wiki/Replace-old-make-command-with-AsyncRun
627+
[19] https://github.com/skywind3000/asyncrun.vim/wiki/Example-for-updating-and-adding-cscope
628+
[20] https://github.com/skywind3000/asyncrun.vim/wiki/FAQ
629+
[21] https://github.com/skywind3000/asyncrun.vim/wiki/Cooperate-with-famous-plugins
630+
[22] https://github.com/skywind3000/asyncrun.vim/wiki/Cooperate-with-famous-plugins#vim-airline
631+
[23] https://github.com/pedsm/sprint
632+
[24] https://github.com/skywind3000/asyncrun.vim/wiki/Get-netrw-using-asyncrun-to-save-remote-files
632633

633634
vim: ft=help

0 commit comments

Comments
 (0)