Created
April 8, 2019 21:17
-
-
Save sirosen/0f287cbc14713159cee902623682ffaa to your computer and use it in GitHub Desktop.
vimrc autodetect py_autoformat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" ALE conf | |
let g:ale_fixers = { | |
\ '*': [], | |
\ 'python': ['isort', 'black'], | |
\} | |
let g:airline#extensions#ale#enabled = 1 | |
" if a '.__py_autoformat' file is in the cwd or a parent of the cwd, enable ALE fix_on_save and tune for black | |
augroup py_ft | |
au! | |
autocmd BufNewFile,BufRead *.py if !empty(findfile("\.\_\_py\_autoformat", ".;")) | let g:ale_fix_on_save = 1 | set textwidth=90 | endif | |
autocmd BufNewFile,BufRead *.py set foldnestmax=1 foldlevel=1 foldmethod=indent | |
augroup END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment