2021-12-10 17:56:46 +01:00

78 lines
2.0 KiB
VimL

set number
set colorcolumn=80
set background=dark
set cursorline
syntax on
" python
au BufNewFile,BufRead *.py,*.go set tabstop=4 softtabstop=4 shiftwidth=4
\ expandtab autoindent fileformat=unix
au BufNewFile,BufRead *.yaml,*.tf 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
" vim-plug
" :PlugInstall to install new one
call plug#begin('~/.vim/plugged')
Plug 'dense-analysis/ale'
Plug 'Valloric/YouCompleteMe'
" enhanced search
Plug 'junegunn/vim-slash'
Plug 'preservim/nerdtree'
Plug 'vim-airline/vim-airline'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'luochen1990/rainbow'
Plug 'psf/black'
Plug 'jvirtanen/vim-hcl' " HCL files used by terraform
" show git diff in sign column
Plug 'airblade/vim-gitgutter'
" Themes
Plug 'sainnhe/sonokai'
" Language specific
Plug 'vim-python/python-syntax'
call plug#end()
" Theme
if has('termguicolors')
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
set termguicolors
endif
let g:sonokai_style = 'atlantis'
let g:sonokai_disable_italic_comment = 1
colorscheme sonokai
let g:airline_theme = 'sonokai'
" Ale
let g:ale_linters = {'python': ['flake8', 'pylint'],}
let g:ale_fixers = {}
let g:ale_fixers.python = ['black']
" Black
let g:black_linelength = 80
" ycm
let g:ycm_autoclose_preview_window_after_insertion = 1
let g:ycm_autoclose_preview_window_after_completion = 1
" NERDTREE
" open nerdtree when no file is specified on startup
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()
" python syntax
let g:python_highlight_all = 1
let g:python_highlight_func_calls = 0
" enable rainbow brackets
let g:rainbow_active = 1