diff --git a/vim/.vim/after/ftplugin/python.vim b/vim/.vim/after/ftplugin/python.vim index a690174..5f3480b 100644 --- a/vim/.vim/after/ftplugin/python.vim +++ b/vim/.vim/after/ftplugin/python.vim @@ -2,7 +2,7 @@ autocmd FileType python map :w:exec '!python3' shellescape(@%, 1) autocmd FileType python imap :w:exec '!python3' shellescape(@%, 1) -set tabstop=4 shiftwidth=4 autoindent smartindent expandtab +set tabstop=4 shiftwidth=4 autoindent smartindent expandtab setlocal colorcolumn=80 setlocal path=.,** @@ -34,3 +34,7 @@ set include=^\\s*\\(from\\\|import\\)\\s*\\zs\\(\\S\\+\\s\\{-}\\)*\\ze\\($\\\|\ " setlocal includeexpr=PyInclude(v:fname) setlocal define=^\\s*\\<\\(def\\\|class\\)\\> +let g:ale_fixers = { +\ '*': ['remove_trailing_lines', 'trim_whitespace'], +\ 'python': ['black', 'add_blank_lines_for_python_control_statements'], +\} diff --git a/vim/.vimrc b/vim/.vimrc index c75c500..a62c213 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -269,6 +269,12 @@ set completeopt+=longest,menu,menuone,preview,noselect,noinsert " endif " endfunction +let g:ale_fixers = { +\ '*': ['remove_trailing_lines', 'trim_whitespace'], +\} + +let g:ale_fix_on_save = 1 + """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " " undotree