An asynchronous Python source code checker for Vim.
Install flake8 by venv
, virtualenv
whatever you like.
pip install flake8
A lot of style checker triggered by save buffer.
vim-snowflake detect source code change immediately and upddate results(no need to save buffer).
TextChange and TextChangeI event can detect more realtime.
autocmd BufWritePost *.py call snowflake#run()
autocmd InsertLeave *.py call snowflake#run()
autocmd TextChanged,TextChangedI *.py call snowflake#run()
Using Vim's job and channels features for asynchronous check.
- Flake8
- Mypy(Experimental support)
snowflake have some hook points to inject various functions.
Hook point | Hook timing |
---|---|
before_init |
Inject to snowflake#init() before called |
after_init |
Inject to snowflake#init() after called |
before_run |
Inject to snowflake#{flake8,mypy}#run() before called |
after_run |
Inject to snowflake#{flake8,mypy}#run() after called |
function! s:snowflake_after(...)
execute ':QuickfixStatusEnable'
execute ':HierUpdate'
endfunction
let g:snowflake_callbacks = {
\ 'after_init': function('snowflake#flake8#run'),
\ 'after_run': function('s:snowflake_after')
\ }
autocmd BufWritePost *.py call snowflake#flake8#run()
autocmd InsertLeave *.py call snowflake#flake8#run()
autocmd TextChanged,TextChangedI *.py call snowflake#flake8#run()
- Execute right after source code open
- Show QuickFix error in statusline, and highlight QuickFix errors run quickfixstatus.vim and vim-hier.
function! s:snowflake_after(...)
execute ':QuickfixStatusEnable'
execute ':HierUpdate'
endfunction
let g:snowflake_callbacks = {
\ 'after_init': function('snowflake#run'),
\ 'after_run': function('s:snowflake_after')
\ }
autocmd BufWritePost *.py call snowflake#run()
autocmd InsertLeave *.py call snowflake#run()
autocmd TextChanged,TextChangedI *.py call snowflake#run()
- Execute right after source code open
- Show QuickFix error in statusline, and highlight QuickFix errors run quickfixstatus.vim and vim-hier.
New BSD License