dotfiles/dotfiles/.vimrc
2021-09-27 09:57:50 +02:00

31 lines
1.2 KiB
VimL
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

set mouse=
execute pathogen#infect()
syntax on
filetype plugin indent on
let g:ycm_global_ycm_extra_conf = "/home/micke/.vim/bundle/YouCompleteMe/.ycm_extra_conf.py"
set autoread
map <C-K> :py3f /usr/share/vim/addons/syntax/clang-format.py<cr>
imap <C-K> <c-o>:py3f /usr/share/vim/addons/syntax/clang-format.py<cr>
function! Formatonsave()
let l:formatdiff = 1
py3f /usr/share/vim/addons/syntax/clang-format.py
endfunction
autocmd BufWritePre *.h,*.cc,*.cpp call Formatonsave()
" Uncomment the following to have Vim jump to the last position when
" reopening a file
if has("autocmd")
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
endif
let g:ale_python_pylint_options = '--extension-pkg-allow-list=wx'
" Check Python files with flake8 and pylint.
let g:ale_linters = {'python': ['mypy', 'flake8']}
" Fix Python files with black and isort.
let g:ale_fixers = {'python': ['yapf', 'isort']}
let g:ale_sign_error = '❌'
let g:ale_sign_warning = '⚠️'
" Start NERDTree and put the cursor back in the other window.
autocmd VimEnter * NERDTree | wincmd p
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
nnoremap <CA-l> :ALEFix<CR>