From a8ea2d4b070934485b7ba65f758f7ec98990b9b4 Mon Sep 17 00:00:00 2001 From: Stefan Friese Date: Thu, 19 Dec 2024 09:31:41 +0100 Subject: [PATCH] added fixers to vimrc and python files --- vim/.vim/after/ftplugin/python.vim | 6 +++++- vim/.vimrc | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) 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