2020-11-13 13:33:21 +01:00
|
|
|
|
" colorscheme peaksea
|
2020-02-14 16:37:50 +01:00
|
|
|
|
colorscheme twilight256
|
2020-11-13 13:33:21 +01:00
|
|
|
|
|
|
|
|
|
let g:ale_set_balloons = 1
|
2020-02-14 16:35:43 +01:00
|
|
|
|
|
2020-11-22 16:01:56 +01:00
|
|
|
|
|
2020-02-14 16:37:46 +01:00
|
|
|
|
set mouse=a relativenumber number foldmethod=indent nofoldenable "without nofoldenable all folds are closed at startup"
|
2020-11-13 13:33:21 +01:00
|
|
|
|
set foldlevelstart=3
|
2020-03-11 15:05:21 +01:00
|
|
|
|
set ttymouse=xterm2 " fix mouse when used in tmux/byobu https://unix.stackexchange.com/q/50733
|
|
|
|
|
|
2020-02-14 16:37:46 +01:00
|
|
|
|
set splitbelow splitright
|
|
|
|
|
set autoread
|
2020-02-14 16:35:43 +01:00
|
|
|
|
set nowrap
|
2020-02-14 16:37:46 +01:00
|
|
|
|
|
2020-02-14 16:37:46 +01:00
|
|
|
|
" ALE configuration
|
2020-03-09 17:54:52 +01:00
|
|
|
|
let g:ale_fixers_aliases = {'vue': ['vue', 'javascript']}
|
2020-04-29 20:33:14 +02:00
|
|
|
|
|
2020-03-09 17:54:52 +01:00
|
|
|
|
let g:ale_fixers = {
|
|
|
|
|
\ '*': ['remove_trailing_lines', 'trim_whitespace'],
|
2020-04-06 19:49:24 +02:00
|
|
|
|
\ 'bash': ['shfmt'],
|
|
|
|
|
\ 'json': ['prettier'],
|
2020-11-16 01:47:04 +01:00
|
|
|
|
\ 'cpp': ['clang-format'],
|
2020-04-06 19:49:24 +02:00
|
|
|
|
\ 'css': ['prettier'],
|
2020-11-13 13:29:44 +01:00
|
|
|
|
\ 'html': ['prettier'],
|
2020-04-06 19:49:24 +02:00
|
|
|
|
\ 'markdown': ['prettier'],
|
2020-11-16 01:47:04 +01:00
|
|
|
|
\ 'java': ['eclipselsp'],
|
|
|
|
|
\ 'yaml': ['prettier'],
|
2020-05-14 17:47:40 +02:00
|
|
|
|
\ 'python': ['black', 'isort'],
|
2020-11-16 01:47:04 +01:00
|
|
|
|
\ 'go': ['gofmt', "goimports"],
|
2020-03-09 17:54:52 +01:00
|
|
|
|
\ 'rust': ['rustfmt'],
|
|
|
|
|
\ "javascript": ["prettier", "eslint"],
|
|
|
|
|
\ "vue": ["prettier", "eslint"]
|
|
|
|
|
\}
|
2020-11-13 13:33:21 +01:00
|
|
|
|
|
2020-04-27 14:25:40 +02:00
|
|
|
|
let g:ale_python_bandit_options = "-c banditrc"
|
2020-11-13 13:33:21 +01:00
|
|
|
|
let g:ale_python_pylint_options = "--rcfile pylintrc --disable=W0511"
|
2020-11-16 01:47:04 +01:00
|
|
|
|
let g:ale_cpp_clang_options = '-std=c++17 -Wall -Wpedantic'
|
|
|
|
|
let g:ale_cpp_gcc_options = '-std=c++17 -Wall -Wpedantic'
|
|
|
|
|
let g:ale_cpp_cc_options = '-std=c++17 -Wall -Wpedantic'
|
|
|
|
|
|
2020-04-27 14:25:40 +02:00
|
|
|
|
|
2020-03-09 17:54:52 +01:00
|
|
|
|
let g:ale_linter_aliases = {'vue': ['vue', 'javascript']}
|
|
|
|
|
let g:ale_linters = {
|
|
|
|
|
\ 'bash': ['bashlint', "shellcheck"],
|
2020-11-13 13:33:21 +01:00
|
|
|
|
\ 'python': ['pyls', 'pylint', 'bandit', 'mypy'],
|
2020-11-16 01:47:04 +01:00
|
|
|
|
\ 'go': ['gopls', 'gobuild'],
|
2020-03-09 17:54:52 +01:00
|
|
|
|
\ 'rust': ['rustc'],
|
|
|
|
|
\ 'yaml': ['yamllint'],
|
2020-04-29 20:33:14 +02:00
|
|
|
|
\ 'javascript': ["yarn lint", "eslint", "vls"]
|
2020-03-09 17:54:52 +01:00
|
|
|
|
\}
|
|
|
|
|
|
2020-04-27 14:25:40 +02:00
|
|
|
|
let g:ack_default_options = " --cc --cpp --shell --python --html --js --vue"
|
2020-11-16 01:47:04 +01:00
|
|
|
|
let g:ale_completion_enabled = 1
|
|
|
|
|
let g:ale_completion_autoimport = 1
|
|
|
|
|
|
2020-02-14 16:35:43 +01:00
|
|
|
|
let g:ale_set_quickfix=1
|
|
|
|
|
let g:ale_set_loclist=0
|
2020-11-13 13:33:21 +01:00
|
|
|
|
" let g:ale_open_list = 1
|
|
|
|
|
" let g:ale_keep_list_window_open = 0
|
2020-02-14 16:35:43 +01:00
|
|
|
|
|
2020-11-13 13:33:21 +01:00
|
|
|
|
let g:ale_lint_on_save = 1
|
2020-02-14 16:37:46 +01:00
|
|
|
|
let g:ale_fix_on_save = 1
|
|
|
|
|
let g:ale_completion_enabled = 1
|
|
|
|
|
|
|
|
|
|
|
2020-02-14 16:37:46 +01:00
|
|
|
|
packadd termdebug
|
2020-02-14 16:37:50 +01:00
|
|
|
|
|
2020-02-14 16:35:43 +01:00
|
|
|
|
" Fix some gitgutter stuff
|
2020-02-14 16:37:50 +01:00
|
|
|
|
let g:gitgutter_enabled = 1
|
2020-02-14 16:35:43 +01:00
|
|
|
|
let g:gitgutter_override_sign_column_highlight = 0
|
|
|
|
|
highlight clear SignColumn
|
|
|
|
|
highlight GitGutterAdd ctermfg=2
|
|
|
|
|
highlight GitGutterChange ctermfg=3
|
|
|
|
|
highlight GitGutterDelete ctermfg=1
|
|
|
|
|
highlight GitGutterChangeDelete ctermfg=4
|
2020-02-14 16:37:50 +01:00
|
|
|
|
|
2020-02-14 16:37:50 +01:00
|
|
|
|
" Highlight all instances of word under cursor, when idle.
|
|
|
|
|
" Useful when studying strange source code.
|
|
|
|
|
" Type z/ to toggle highlighting on/off.
|
|
|
|
|
nnoremap z/ :if AutoHighlightToggle()<Bar>set hls<Bar>endif<CR>
|
|
|
|
|
function! AutoHighlightToggle()
|
|
|
|
|
let @/ = ''
|
|
|
|
|
if exists('#auto_highlight')
|
|
|
|
|
au! auto_highlight
|
|
|
|
|
augroup! auto_highlight
|
|
|
|
|
setl updatetime=4000
|
|
|
|
|
echo 'Highlight current word: off'
|
|
|
|
|
return 0
|
|
|
|
|
else
|
|
|
|
|
augroup auto_highlight
|
|
|
|
|
au!
|
|
|
|
|
au CursorHold * let @/ = '\V\<'.escape(expand('<cword>'), '\').'\>'
|
|
|
|
|
augroup end
|
|
|
|
|
setl updatetime=500
|
|
|
|
|
echo 'Highlight current word: ON'
|
|
|
|
|
return 1
|
|
|
|
|
endif
|
|
|
|
|
endfunction
|
2020-02-14 16:37:51 +01:00
|
|
|
|
|
|
|
|
|
" A friggin python breakpoint. Invoke with @b
|
|
|
|
|
let @b = 'A
breakpoint()<1B><>ajkj0'
|
|
|
|
|
|
2019-12-27 01:24:53 +01:00
|
|
|
|
let g:ctrlp_custom_ignore = {
|
2020-11-22 16:02:49 +01:00
|
|
|
|
\ 'dir': '\v(target|build|dist|.venv)$',
|
2019-12-27 01:24:53 +01:00
|
|
|
|
\ }
|
|
|
|
|
" \ 'file': '\v\.(exe|so|dll)$',
|
|
|
|
|
" \ 'link': 'some_bad_symbolic_links',
|
2020-04-06 19:46:13 +02:00
|
|
|
|
let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files -co --exclude-standard']
|
2019-12-27 01:24:53 +01:00
|
|
|
|
|
2020-02-09 14:37:18 +01:00
|
|
|
|
nnoremap <leader>mk :bel copen<bar>silent (cargo run) !<bar>redraw!<cr>
|
|
|
|
|
|
2020-02-14 16:35:43 +01:00
|
|
|
|
autocmd FileType yaml setlocal shiftwidth=2 softtabstop=2 expandtab
|
2020-03-09 17:57:37 +01:00
|
|
|
|
autocmd FileType yml setlocal shiftwidth=2 softtabstop=2 expandtab
|
2020-02-14 16:35:43 +01:00
|
|
|
|
|
2020-03-09 17:57:23 +01:00
|
|
|
|
" Improve vimdiff colors
|
|
|
|
|
highlight DiffAdd cterm=bold ctermfg=10 ctermbg=17 gui=none guifg=bg guibg=Red
|
|
|
|
|
highlight DiffDelete cterm=bold ctermfg=10 ctermbg=17 gui=none guifg=bg guibg=Red
|
|
|
|
|
highlight DiffChange cterm=bold ctermfg=10 ctermbg=17 gui=none guifg=bg guibg=Red
|
|
|
|
|
highlight DiffText cterm=bold ctermfg=10 ctermbg=88 gui=none guifg=bg guibg=Red
|
2020-03-09 17:58:07 +01:00
|
|
|
|
|
2020-03-09 17:58:39 +01:00
|
|
|
|
|
|
|
|
|
function! WinZoomToggle() abort
|
|
|
|
|
if ! exists('w:WinZoomIsZoomed')
|
|
|
|
|
let w:WinZoomIsZoomed = 0
|
|
|
|
|
endif
|
|
|
|
|
if w:WinZoomIsZoomed == 0
|
|
|
|
|
let w:WinZoomOldWidth = winwidth(0)
|
|
|
|
|
let w:WinZoomOldHeight = winheight(0)
|
|
|
|
|
wincmd _
|
|
|
|
|
wincmd |
|
|
|
|
|
let w:WinZoomIsZoomed = 1
|
|
|
|
|
elseif w:WinZoomIsZoomed == 1
|
|
|
|
|
execute "resize " . w:WinZoomOldHeight
|
|
|
|
|
execute "vertical resize " . w:WinZoomOldWidth
|
|
|
|
|
let w:WinZoomIsZoomed = 0
|
|
|
|
|
endif
|
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
|
|
nnoremap <leader>wz :call WinZoomToggle()<CR>
|
2020-03-13 21:34:36 +01:00
|
|
|
|
|
|
|
|
|
nnoremap <leader>/ :G<CR>
|
|
|
|
|
nnoremap <leader>C :close<CR>
|
|
|
|
|
nnoremap <leader>B :Bclose<CR>
|
2020-12-03 18:33:44 +01:00
|
|
|
|
nnoremap <leader>k :Ack<Space>
|
2020-11-22 16:01:56 +01:00
|
|
|
|
nnoremap <leader>g :Git<CR>
|
2020-11-13 13:29:44 +01:00
|
|
|
|
nnoremap <leader>gd :Git diff<CR>
|
|
|
|
|
nnoremap <leader>gp :Git push<CR>
|
|
|
|
|
nnoremap <leader>gpf :Git push --force-with-lease<CR>
|
2020-03-13 21:34:36 +01:00
|
|
|
|
nnoremap <leader>M :Git commit<CR>
|
2020-03-30 03:37:39 +02:00
|
|
|
|
nnoremap <leader>u :GitGutterBufferToggle<CR>
|
2020-04-27 14:25:40 +02:00
|
|
|
|
nnoremap <leader>L :GitGutterLineHighlightsToggle<CR>
|
2020-04-06 19:44:51 +02:00
|
|
|
|
|
|
|
|
|
nmap <silent> <C-k> <Plug>(ale_previous_wrap)
|
|
|
|
|
nmap <silent> <C-j> <Plug>(ale_next_wrap)
|
|
|
|
|
|
2020-06-14 17:10:12 +02:00
|
|
|
|
nmap <leader>sv :ALEGoToDefinition -vsplit<CR>
|
|
|
|
|
nmap <leader>sh :ALEGoToDefinition -split<CR>
|
|
|
|
|
nmap <leader>st :ALEGoToDefinition -tab<CR>
|
2020-04-06 19:44:51 +02:00
|
|
|
|
nmap <leader>A :ALEGoToDefinition<CR>
|
|
|
|
|
nmap <leader>n :ALEFindReferences<CR>
|
2020-11-13 13:29:44 +01:00
|
|
|
|
nmap <leader>h :ALEHover<CR>
|
2020-04-06 19:44:51 +02:00
|
|
|
|
nmap <leader>r :ALERename<CR>
|
2020-04-27 14:25:40 +02:00
|
|
|
|
|
2020-11-13 13:29:44 +01:00
|
|
|
|
nmap <leader>t :CtrlPTag<CR>
|
|
|
|
|
|
2020-04-29 20:35:10 +02:00
|
|
|
|
" Add shortcuts to yank/paste to unnamed/unnamedplus clipboards
|
|
|
|
|
noremap <Leader>y "*y
|
|
|
|
|
noremap <Leader>p "*p
|
|
|
|
|
noremap <Leader>Y "+y
|
|
|
|
|
noremap <Leader>P "+p
|
2020-12-03 18:33:44 +01:00
|
|
|
|
|
|
|
|
|
" These are the default mappings Default mappings
|
|
|
|
|
let g:multi_cursor_start_word_key = '<C-n>'
|
|
|
|
|
let g:multi_cursor_select_all_word_key = '<A-n>'
|
|
|
|
|
let g:multi_cursor_start_key = 'g<C-n>'
|
|
|
|
|
let g:multi_cursor_select_all_key = 'g<A-n>'
|
|
|
|
|
let g:multi_cursor_next_key = '<C-n>'
|
|
|
|
|
let g:multi_cursor_prev_key = '<C-p>'
|
|
|
|
|
let g:multi_cursor_skip_key = '<C-x>'
|
|
|
|
|
let g:multi_cursor_quit_key = '<Esc>'
|