vimrc: use filetypes for formatting
All checks were successful
dotfiles/pipeline/head This commit looks good

This commit is contained in:
Johannes Rothe 2022-01-04 10:44:46 +01:00 committed by Johannes Rothe
parent bda0a10ae6
commit a0ebd3eeb6

View File

@ -2,16 +2,25 @@ set number
set colorcolumn=88
set background=dark
set cursorline
set shell=/bin/sh
syntax on
" python
au BufNewFile,BufRead *.py,*.go set tabstop=4 softtabstop=4 shiftwidth=4
au BufNewFile,BufRead *.go set tabstop=4 softtabstop=4 shiftwidth=4
\ expandtab autoindent fileformat=unix
au BufNewFile,BufRead *.yaml,*.tf set tabstop=2 softtabstop=2 shiftwidth=2
au BufNewFile,BufRead *.yaml set tabstop=2 softtabstop=2 shiftwidth=2
\ expandtab autoindent fileformat=unix
au BufNewFile,BufRead *.html,*.css set tabstop=2 softtabstop=2 shiftwidth=2
\ expandtab autoindent colorcolumn=0
au BufNewFile,BufRead *.launch set filetype=xml
augroup py
autocmd FileType python :set tabstop=4 softtabstop=4 shiftwidth=4 expandtab autoindent fileformat=unix
autocmd FileType python nnoremap <F9> :Black<CR> :Isort <CR>
augroup end
augroup terraform
autocmd FileType terraform :set tabstop=2 softtabstop=2 shiftwidth=2 expandtab autoindent fileformat=unix
autocmd FileType terraform nnoremap <F9> :! terraform fmt<CR>
augroup end
" vim-plug
" :PlugInstall to install new one
@ -70,7 +79,6 @@ 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> :Isort <CR>
" RAINBOW_PARENTHESES
au FileType c,cpp,py call rainbow#load()