amake.nvim
amake.nvim copied to clipboard
Asynchronous make for neovim
Amake.nvim
Asynchronous :make for neovim
Make/build/lint/test execution without blocking your work flow. Executes defined commands and populated quickfix window with errors found.
Install
Using vim-plug or your favorite plugin manager
Plug 'antonk52/amake.nvim'
Commands
:Amake <job>- executesjob:AmakeJobs- lists known jobs
Configuration
amake.nvim has a default dictionary of jobs which can be extended by settings g:amake_jobs.
A job is a table/dictionary that can have following properties:
cmdcommand to execute a job(table or dictionary) requirederror_formatused to match error from command output(string) for syntax see:help errorformatrequiredmsg_successprinted when command had no errors(string)msg_failprinted when command had errors(string)
For message fields you can use placeholders for:
{{count}}error count{{job}}job name
Jobs can be setup using vimscript or lua. See examples.
" vim
let g:amake_jobs = {
\ 'typescript': {
\ 'cmd': ['npx', 'tsc', '--noEmit'],
\ 'error_format': '%E\ %#%f\ %#(%l\\\,%c):\ error\ TS%n:\ %m,%C%m',
\ 'msg_success': 'No errors!',
\ 'msg_error': '{{job}}: {{count}} errors found',
\ }
\ }
or
-- lua
require('amake').setup({
jobs = {
typescript = {
cmd = {'npx', 'tsc', '--noEmit'},
-- note that each `\` has to be escaped
error_format = '%E\\ %#%f\\ %#(%l\\\\\\,%c):\\ error\\ TS%n:\\ %m,%C%m',
msg_success = 'No errors!',
msg_error = '{{job}}: {{count}} errors found',
}
}
})