1
0
mirror of https://git.decapod.one/brethil/dotfiles synced 2024-11-10 05:51:30 +01:00
dotfiles/vim/plugins_config.vim

Failed to ignore revisions in .git-blame-ignore-revs.

298 lines
8.9 KiB
VimL
Raw Normal View History

2020-12-06 02:29:15 +01:00
"""" PLUGINS CONFIGURATION
" ALE configuration
2021-11-16 14:28:31 +01:00
"
let g:ale_python_auto_poetry = 1
2020-12-06 02:29:15 +01:00
let g:ale_set_balloons = 1 " enable tooltips
let g:ale_fixers = {
\ '*': ['remove_trailing_lines', 'trim_whitespace'],
\ 'bash': ['shfmt'],
2021-05-19 10:30:35 +02:00
\ 'sh': ['shfmt'],
2020-12-06 02:29:15 +01:00
\ 'json': ['prettier'],
2021-03-08 09:57:57 +01:00
\ 'c': ['clang-format'],
2020-12-06 02:29:15 +01:00
\ 'cpp': ['clang-format'],
2023-09-14 23:00:09 +02:00
\ 'cmake': ['cmakeformat'],
2020-12-06 02:29:15 +01:00
\ 'css': ['prettier'],
\ 'html': ['prettier'],
2023-09-14 23:00:09 +02:00
\ 'kotlin': ['ktlint'],
2020-12-06 02:29:15 +01:00
\ 'markdown': ['prettier'],
2021-03-15 10:37:52 +01:00
\ 'terraform': ['terraform'],
2020-12-06 02:29:15 +01:00
\ 'yaml': ['prettier'],
2023-12-04 10:21:14 +01:00
\ 'python': ['ruff_format'],
2023-01-19 17:33:11 +01:00
\ 'go': ['gofmt', 'goimports'],
2020-12-06 02:29:15 +01:00
\ 'rust': ['rustfmt'],
2021-09-26 15:59:46 +02:00
\ 'sql': ['pgformatter'],
2023-09-14 23:00:09 +02:00
\ 'java': ['clang-format'],
2023-01-19 17:33:11 +01:00
\ 'javascript': ['prettier', 'eslint'],
2023-09-14 23:00:09 +02:00
\ 'vue': ['prettier', 'eslint'],
2020-12-06 02:29:15 +01:00
\}
2023-09-14 23:55:29 +02:00
let g:ale_fixers_aliases = {'vue': ['vue', 'javascript'], 'arduino': 'cpp'}
let g:ale_arduino_ccls_executable = 'ccls'
let g:ale_arduino_ccls_init_options = {}
let g:ale_popup_menu_enabled = 1
2023-01-19 17:33:11 +01:00
let g:ale_python_bandit_options = '-c banditrc'
let g:ale_python_pylint_options = '-j0 --disable=W0511'
let g:ale_python_mypy_options = '--ignore-missing-imports'
2021-10-01 10:37:51 +02:00
2021-03-13 15:31:26 +01:00
" let g:ale_cpp_clang_options = '-std=c++17 -Wall -Wpedantic'
" let g:ale_cpp_gcc_options = '-std=c++17 -Wall -Wpedantic'
2021-12-09 00:11:19 +01:00
let g:ale_rust_cargo_use_clippy = 1
2020-12-06 02:29:15 +01:00
let g:ale_linters = {
2023-01-19 17:33:11 +01:00
\ 'bash': ['bash-language-server', 'bashlint', 'shellcheck'],
\ 'dockerfile': ['hadolint'],
\ 'zsh': ['bashlint', 'shellcheck'],
2023-09-14 23:02:10 +02:00
\ 'c': ['ccls', 'clangd'],
2021-03-13 15:31:26 +01:00
\ 'cpp': ['clangd'],
2023-09-14 23:02:10 +02:00
\ 'qml': ['qmllint'],
\ 'python': ['pylsp', 'mypy', 'ruff'],
2020-12-06 02:29:15 +01:00
\ 'go': ['gopls', 'gobuild'],
2023-09-14 23:02:10 +02:00
\ 'rust': ['analyzer', 'cargo'],
2020-12-06 02:29:15 +01:00
\ 'yaml': ['yamllint'],
2023-09-14 23:02:10 +02:00
\ 'javascript': ['yarn lint', 'eslint'],
\ 'xml': ['android'],
\ 'groovy': ['android'],
\ 'java': ['eclipselsp', 'android'],
\ 'kotlin': ['android', 'ktlint', 'languageserver'],
\ 'vue': ['volar', 'eslint']
2020-12-06 02:29:15 +01:00
\}
2023-09-14 23:55:29 +02:00
let g:ale_linter_aliases = {'vue': ['vue', 'javascript'], 'arduino': 'cpp'}
" disable gradle signs/loclist as they conflict with ALE (vim-android)
let g:gradle_loclist_show = 0
let g:gradle_show_signs = 0
let g:ale_java_eclipselsp_path = '~/git/eclipse.jdt.ls'
2023-01-19 17:33:11 +01:00
let g:ale_yaml_yamllint_options = '--config .editorconfig'
2020-12-06 02:29:15 +01:00
let g:ale_open_list = 0
let g:ale_keep_list_window_open = 1
let g:ale_lint_on_save = 1
let g:ale_lint_on_enter = 1
let g:ale_lint_on_insert_leave = 1
let g:ale_lint_on_text_changed = 0
2020-12-06 02:29:15 +01:00
let g:ale_lint_delay = 2500 " lint 2.5 seconds after text has changed
augroup androiddev
" avoid death by gradle
autocmd! FileType java,kotlin let g:ale_lint_on_insert_leave = 0
augroup END
2020-12-06 02:29:15 +01:00
let g:ale_fix_on_save = 1
let g:ale_cursor_detail=1
let g:ale_detail_to_floating_preview = 1
let g:ale_completion_enabled = 1
" let g:ale_completion_autoimport = 1
2020-12-06 02:29:15 +01:00
2021-12-09 10:22:18 +01:00
let g:ale_lsp_show_message_severity = 'information'
let g:ale_lsp_suggestions = 1
let g:ale_rename_tsserver_find_in_comment = 1
2020-12-06 02:29:15 +01:00
let g:ale_sign_priority = 99
2023-01-19 17:33:11 +01:00
let g:ale_sign_error = 'xx'
let g:ale_sign_warning = '>>'
let g:ale_sign_info = '--'
2020-12-06 02:29:15 +01:00
"let g:ale_sign_style_error =
"let g:ale_sign_style_warning =
highlight link ALEVirtualTextError ALEError
highlight link ALEVirtualTextWarning ALEWarning
let g:ale_virtualtext_column = "45%"
let g:ale_virtualtext_single = 0 " show all errors
let g:ale_virtualtext_prefix= "[%linter%] %code: %"
let g:ale_exclude_highlights = [
\ 'line too long',
\]
augroup rust
autocmd!
autocmd BufRead *.rs let g:ale_set_highlights = 0
augroup END
2020-12-06 02:29:15 +01:00
2021-03-15 10:15:13 +01:00
let g:ale_completion_symbols = {
\ 'text': '',
\ 'method': '',
\ 'function': '',
\ 'constructor': '',
\ 'field': '',
\ 'variable': '',
\ 'class': '',
\ 'interface': '',
\ 'module': '',
\ 'property': '',
\ 'unit': 'unit',
\ 'value': 'val',
\ 'enum': '',
\ 'keyword': 'keyword',
\ 'snippet': '',
\ 'color': 'color',
\ 'file': '',
\ 'reference': 'ref',
\ 'folder': '',
\ 'enum member': '',
\ 'constant': '',
\ 'struct': '',
\ 'event': 'event',
\ 'operator': '',
\ 'type_parameter': 'type param',
\ '<default>': 'v'
\ }
2020-12-06 02:29:15 +01:00
" Fix some gitgutter stuff
let g:gitgutter_enabled = 1
let g:gitgutter_sign_allow_clobber = 0 " do not allow gitgutter to overwrite signs
let g:gitgutter_sign_priority = 50
let g:gitgutter_sign_added = '+'
let g:gitgutter_sign_modified = '~'
let g:gitgutter_sign_modified_removed = 'x'
2020-12-07 15:36:18 +01:00
" Airline config
2021-12-08 23:55:17 +01:00
" set laststatus=2
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#show_splits = 1
" let g:airline#extensions#tabline#tab_nr_type = 2
let g:airline#extensions#tabline#buffer_idx_mode = 1
nmap <leader>1 <Plug>AirlineSelectTab1
nmap <leader>2 <Plug>AirlineSelectTab2
nmap <leader>3 <Plug>AirlineSelectTab3
nmap <leader>4 <Plug>AirlineSelectTab4
nmap <leader>5 <Plug>AirlineSelectTab5
nmap <leader>6 <Plug>AirlineSelectTab6
nmap <leader>7 <Plug>AirlineSelectTab7
nmap <leader>8 <Plug>AirlineSelectTab8
nmap <leader>9 <Plug>AirlineSelectTab9
nmap <leader>0 <Plug>AirlineSelectTab0
nmap <leader>- <Plug>AirlineSelectPrevTab
nmap <leader>+ <Plug>AirlineSelectNextTab
2020-12-07 15:36:18 +01:00
let g:airline_theme='gruvbox'
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
let g:airline_left_sep = ''
let g:airline_left_alt_sep = ''
let g:airline_right_sep = ''
let g:airline_right_alt_sep = ''
let g:airline_symbols.branch = ''
let g:airline_symbols.readonly = ''
2021-12-08 23:55:17 +01:00
let g:airline_symbols.colnr = ':'
2020-12-07 15:36:18 +01:00
let g:airline_symbols.linenr = ''
2021-12-08 23:55:17 +01:00
let g:airline_symbols.maxlinenr = ''
2021-02-21 23:07:22 +01:00
let g:airline_section_y = ''
let g:airline#extensions#tagbar#enabled = 1
let g:airline_section_x=' %{tagbar#currenttag("%s", "", "f")}'
let g:airline#extensions#tagbar#flags = 's'
2021-12-08 23:55:17 +01:00
let g:airline#extensions#tagbar#searchmethod = 'scoped-stl'
" only these functions will only be defined when lightline#gradle#... funtions
" are defined, which happens when vim-android is loaded
if exists('lightline#gradle#running')
call airline#parts#define_function(
\ 'gradle-running',
\ 'lightline#gradle#running'
\)
call airline#parts#define_function(
\ 'gradle-errors',
\ 'lightline#gradle#errors'
\)
call airline#parts#define_function(
\ 'gradle-warnings',
\ 'lightline#gradle#warnings'
\)
call airline#parts#define_function(
\ 'gradle-project',
\ 'lightline#gradle#project'
\)
let g:airline_section_x= airline#section#create_right([
\ 'filetype',
\ 'gradle-running',
\ 'gradle-errors',
\ 'gradle-warnings'
\])
let g:gradle_glyph_gradle = ''
let g:gradle_glyph_android = ''
let g:gradle_glyph_error = ''
let g:gradle_glyph_warning = ''
let g:gradle_glyph_building = ''
endif
2020-12-06 02:29:15 +01:00
" These are the default mappings for vim-multi-cursor
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>'
2020-12-06 02:29:15 +01:00
" indent-guides, toggle with <leader>ig
let g:indent_guides_enable_on_vim_startup = 0
let g:indent_guides_exclude_filetypes = ['help', 'terminal', 'nerdtree']
let g:indent_guides_start_level = 2
let g:indent_guides_guide_size = 1
"" Gutentags"
let g:gutentags_cache_dir = expand('~/.vim/ctags_cache/')
let g:gutentags_file_list_command = {
\ 'markers': {
\ '.git': 'git ls-files',
\ '.hg': 'hg files',
\ },
\ }
let g:gutentags_generate_on_empty_buffer = 1
let g:gutentags_ctags_exclude = ['build', 'dist', '*css', '*json', '*yaml', '*md', '.venv', '*rst']
let g:gutentags_ctags_extra_args = ['--tag-relative=always', ]
2021-08-09 18:37:58 +02:00
"" nerdtree
let NERDTreeIgnore=['__pycache__']
2021-09-30 12:42:37 +02:00
" ultisnips
2023-01-19 17:33:11 +01:00
let g:UltiSnipsExpandTrigger='<tab>'
let g:UltiSnipsJumpForwardTrigger='<c-j>'
let g:UltiSnipsJumpBackwardTrigger='<c-k>'
let g:UltiSnipsEditSplit='context'
2021-09-26 17:32:11 +02:00
"" Fzf
2021-12-13 00:52:20 +01:00
let g:fzf_layout = { 'window': { 'width': 1, 'height': 0.9 } }
2021-12-22 12:57:55 +01:00
let g:fzf_colors =
\ { 'fg': ['fg', 'Normal'],
\ 'bg': ['bg', 'Normal'],
\ 'hl': ['fg', 'Comment'],
\ 'fg+': ['fg', 'CursorLine', 'CursorColumn', 'Normal'],
\ 'bg+': ['bg', 'CursorLine', 'CursorColumn'],
\ 'hl+': ['fg', 'Statement'],
\ 'info': ['fg', 'PreProc'],
\ 'border': ['fg', 'Ignore'],
\ 'prompt': ['fg', 'Conditional'],
\ 'pointer': ['fg', 'Exception'],
\ 'marker': ['fg', 'Keyword'],
\ 'spinner': ['fg', 'Label'],
\ 'header': ['fg', 'Comment'] }
2021-12-09 10:47:29 +01:00
autocmd! FileType fzf
autocmd FileType fzf set laststatus=0 noshowmode noruler
\| autocmd BufLeave <buffer> set laststatus=2 showmode ruler
2022-04-04 15:47:31 +02:00
2023-01-19 17:33:11 +01:00
let g:goyo_width='85%'
2022-04-04 15:47:31 +02:00
let g:goyo_linenr=1
2024-07-01 12:23:14 +02:00
" vim-go
" let g:go_doc_balloon = 1
let g:go_doc_keywordprg_enabled=0