dotfiles/.vim/python.vimrc.vim
t14 6a396b996f
vimrc(lsp,ale): lint with pylsp+autoformat python
...if relevant formatters are available. also, default to hard tabs.
2024-07-06 11:55:02 +02:00

32 lines
898 B
VimL

" vim-python
augroup vimrc-python
autocmd!
autocmd FileType python setlocal noexpandtab shiftwidth=4 tabstop=4 colorcolumn=79
\ formatoptions+=croq softtabstop=4
\ cinwords=if,elif,else,for,while,try,except,finally,def,class,with
augroup END
" jedi-vim
let g:jedi#popup_on_dot = 0
let g:jedi#goto_assignments_command = '<leader>g'
let g:jedi#goto_definitions_command = '<leader>d'
let g:jedi#documentation_command = 'K'
let g:jedi#usages_command = '<leader>n'
let g:jedi#rename_command = '<leader>r'
let g:jedi#show_call_signatures = '0'
let g:jedi#completions_command = '<C-Space>'
let g:jedi#smart_auto_mappings = 0
" ale
:call extend(g:ale_linters, {
\'python': ['ruff', 'flake8', 'pylsp'], })
":call extend(g:ale_fixers, {
" \'python': ['ruff_format'], })
" vim-airline
let g:airline#extensions#virtualenv#enabled = 1
" Syntax highlight
let python_highlight_all = 1