https://github.com/heavenshell/vim-snowflake
An asynchronous Python source code checker for Vim.
https://github.com/heavenshell/vim-snowflake
flake8 python vim
Last synced: 2 months ago
JSON representation
An asynchronous Python source code checker for Vim.
- Host: GitHub
- URL: https://github.com/heavenshell/vim-snowflake
- Owner: heavenshell
- License: bsd-3-clause
- Created: 2016-12-31T03:44:54.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-01-29T05:10:36.000Z (over 9 years ago)
- Last Synced: 2025-03-06T02:12:12.568Z (over 1 year ago)
- Topics: flake8, python, vim
- Language: Vim script
- Size: 5.67 MB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vim-snowflake
[](https://travis-ci.org/heavenshell/vim-snowflake)
An asynchronous Python source code checker for Vim.

## Features
Install flake8 by `venv`, `virtualenv` whatever you like.
```console
pip install flake8
```
### Realtime check
A lot of style checker triggered by save buffer.
vim-snowflake detect source code change immediately and upddate results(no need to save buffer).
### More realtime
TextChange and TextChangeI event can detect more realtime.
```viml
autocmd BufWritePost *.py call snowflake#run()
autocmd InsertLeave *.py call snowflake#run()
autocmd TextChanged,TextChangedI *.py call snowflake#run()
```
### Async
Using Vim's job and channels features for asynchronous check.
### Style checkers
- Flake8
- Mypy(Experimental support)
## Configurations
### Integrate with other plugins
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 |
#### Run Flake8, QuickFixStatus and Vim-Hier
```viml
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.
#### Run Flake8, Mypy, QuickFixStatus and Vim-Hier.
```viml
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.
## License
New BSD License