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

View File

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