Add black formatting to vim

This commit is contained in:
Johannes Rothe 2021-08-27 00:21:13 +02:00
parent 671f2625e5
commit e0cc8e6795
2 changed files with 9 additions and 3 deletions

View File

@ -26,6 +26,7 @@ Plug 'vim-airline/vim-airline'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'luochen1990/rainbow'
Plug 'psf/black'
" Themes
Plug 'crusoexia/vim-monokai'
" Language specific
@ -35,9 +36,11 @@ call plug#end()
" ale: apt install pylint flake8
" Ale
let g:ale_linters = {
\ 'python': ['flake8', 'pylint'],
\}
let g:ale_linters = {'python': ['flake8', 'pylint'],}
let g:ale_fixers = {}
let g:ale_fixers.python = ['black']
let g:black_linelength = 80
" NERDTREE
" open nerdtree when no file is specified on startup
@ -45,6 +48,7 @@ autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
" toggle nerdtree keyboard shortcut
map <C-t> :NERDTreeToggle<CR>
nnoremap <F9> :Black<CR>
" RAINBOW_PARENTHESES
au FileType c,cpp,py call rainbow#load()

View File

@ -7,6 +7,7 @@
apt:
name:
- ack
- black # code formatting
- feh # set background
- fish
- fzf
@ -18,6 +19,7 @@
- nitrogen
- pass
- polybar
- python3-pylint-common
- pulseaudio-utils # pactl volume control
- rofi # dmenu replacement
- scrot # screenshot