2021-01-21 22:14:18 +01:00
|
|
|
set number
|
2022-01-03 14:42:19 +01:00
|
|
|
set colorcolumn=88
|
2021-01-21 22:14:18 +01:00
|
|
|
set background=dark
|
2021-01-22 22:33:56 +01:00
|
|
|
set cursorline
|
2022-01-04 10:44:46 +01:00
|
|
|
set shell=/bin/sh
|
2021-01-21 22:14:18 +01:00
|
|
|
syntax on
|
|
|
|
|
|
|
|
" python
|
2022-01-04 10:44:46 +01:00
|
|
|
au BufNewFile,BufRead *.go set tabstop=4 softtabstop=4 shiftwidth=4
|
2021-12-10 17:56:46 +01:00
|
|
|
\ expandtab autoindent fileformat=unix
|
2022-01-04 10:44:46 +01:00
|
|
|
au BufNewFile,BufRead *.yaml set tabstop=2 softtabstop=2 shiftwidth=2
|
2021-12-10 17:56:46 +01:00
|
|
|
\ expandtab autoindent fileformat=unix
|
|
|
|
au BufNewFile,BufRead *.html,*.css set tabstop=2 softtabstop=2 shiftwidth=2
|
2021-08-26 14:08:11 +02:00
|
|
|
\ expandtab autoindent colorcolumn=0
|
2021-01-21 22:14:18 +01:00
|
|
|
au BufNewFile,BufRead *.launch set filetype=xml
|
2022-01-04 10:44:46 +01:00
|
|
|
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
|
2022-02-02 09:53:57 +01:00
|
|
|
autocmd FileType terraform :set tabstop=2 softtabstop=2 shiftwidth=2 expandtab autoindent fileformat=unix
|
|
|
|
autocmd FileType terraform nnoremap <F9> :! terraform fmt<CR>
|
|
|
|
augroup end
|
|
|
|
augroup sh
|
|
|
|
autocmd FileType sh :set tabstop=2 softtabstop=2 shiftwidth=2 expandtab autoindent fileformat=unix
|
2022-01-04 10:44:46 +01:00
|
|
|
augroup end
|
2021-01-21 22:14:18 +01:00
|
|
|
|
|
|
|
" 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'
|
2022-01-14 21:30:40 +01:00
|
|
|
Plug 'psf/black', {'branch': 'main'}
|
2022-01-03 16:47:05 +01:00
|
|
|
Plug 'fisadev/vim-isort'
|
2021-12-10 17:56:46 +01:00
|
|
|
Plug 'jvirtanen/vim-hcl' " HCL files used by terraform
|
2021-08-28 00:47:43 +02:00
|
|
|
" show git diff in sign column
|
|
|
|
Plug 'airblade/vim-gitgutter'
|
2021-01-21 22:14:18 +01:00
|
|
|
" Themes
|
2021-08-27 01:26:50 +02:00
|
|
|
Plug 'sainnhe/sonokai'
|
2021-01-21 22:14:18 +01:00
|
|
|
" Language specific
|
2021-08-27 02:26:32 +02:00
|
|
|
Plug 'vim-python/python-syntax'
|
2022-02-06 14:10:54 +01:00
|
|
|
Plug 'wgwoods/vim-systemd-syntax'
|
2021-01-21 22:14:18 +01:00
|
|
|
call plug#end()
|
2021-08-27 01:26:50 +02:00
|
|
|
|
|
|
|
" 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
|
2021-08-31 15:59:59 +02:00
|
|
|
let g:sonokai_style = 'atlantis'
|
2021-08-27 01:26:50 +02:00
|
|
|
let g:sonokai_disable_italic_comment = 1
|
|
|
|
colorscheme sonokai
|
|
|
|
let g:airline_theme = 'sonokai'
|
2021-01-21 22:14:18 +01:00
|
|
|
|
|
|
|
" Ale
|
2021-12-22 14:29:50 +01:00
|
|
|
let g:ale_linters = {'python': ['pylint', 'mypy'],}
|
|
|
|
let g:ale_fixers = {'python': ['black', 'isort']}
|
2021-12-17 18:14:07 +01:00
|
|
|
let g:ale_python_pylint_options = '--disable=C0111'
|
2021-12-22 14:29:50 +01:00
|
|
|
let g:ale_python_mypy_options = '--ignore-missing-imports --disallow-untyped-defs --disallow-incomplete-defs'
|
2021-08-27 00:21:13 +02:00
|
|
|
|
2021-08-27 01:26:50 +02:00
|
|
|
" Black
|
2022-01-03 14:42:19 +01:00
|
|
|
let g:black_linelength = 88
|
2021-01-21 22:14:18 +01:00
|
|
|
|
2021-08-27 01:26:50 +02:00
|
|
|
" ycm
|
|
|
|
let g:ycm_autoclose_preview_window_after_insertion = 1
|
|
|
|
let g:ycm_autoclose_preview_window_after_completion = 1
|
|
|
|
|
2022-01-03 16:47:05 +01:00
|
|
|
" isort
|
|
|
|
let g:vim_isort_python_version = 'python3'
|
|
|
|
let g:vim_isort_config_overrides = {'profile': 'black'}
|
|
|
|
|
2021-01-21 22:14:18 +01:00
|
|
|
" 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>
|
|
|
|
|
|
|
|
" 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
|