Skip to content

icebreaker/asynctotem.vim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

asynctotem.vim

A lean and mean async command runner for Vim 8 and later.

Please note, that only one command can be running at any given time. This is by design.

Mappings

map <C-b> :call asynctotem#run(&makeprg)<CR>
map <C-r> :call asynctotem#run(&makeprg, 'release')<CR>
map <C-r> :call asynctotem#run('random command')<CR>
map <C-r> :call asynctotem#run('random command', 'random arguments')<CR>

Commands

command! -nargs=+ -complete=shellcmd Arun call asynctotem#run(<q-args>)
command! -nargs=+ -complete=shellcmd Amake call asynctotem#run(&makeprg, <q-args>)
command! -nargs=+ -complete=shellcmd Agrep call asynctotem#run(&grepprg, <q-args>)

Status

The asynctotem#status() function, can be used in order to display the run status in a configurable statusline plugin like lightline.

let g:lightline =
      \ {
      \   'active': {
      \     'left': [['mode', 'paste'], ['gitbranch'], ['asynctotem', 'readonly', 'filename', 'modified']]
      \   },
      \   'component_function': {
      \     'gitbranch': 'fugitive#head',
      \     'asynctotem': 'asynctotem#status'
      \   }
      \ }

Customization

There are a couple of global variables that can be used to alter some of the default behavior.

let g:asynctotem_copen_keymap

Set this to 0, in order to stop q being mapped to :cclose and ctrl+c to the asynctotem#kill() function in the Quickfix window.

The default is 1.

let g:asynctotem_cclose_on_kill

Set this to 1, in order to close the Quickfix window when asynctotem#kill() is called.

The default is 0.

let g:asynctotem_cclose_on_no_error

Set this to 1, in order to close the Quickfix window when there are no errors.

The default is 0.

let g:asynctotem_cclose_delay

Set this to the desired amount of milliseconds after which the Quickfix window will be closed, when g:asynctotem_cclose_on_kill or g:asynctotem_cclose_on_no_error are set to 1.

The default is 1000ms (1 second).

Contribute

  • Fork the project.
  • Make your feature addition or bug fix.
  • Do not bump the version number.
  • Send me a pull request. Bonus points for topic branches.

License

Copyright (c) Mihail Szabolcs. Distributed under the same terms as Vim itself. See :help license.

About

A lean and mean async command runner for Vim 8 and later.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published