From 2310730e3fd4dbb72ac89b15b2947db89c153123 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Wed, 22 May 2024 09:07:35 +0100 Subject: Mainly adds YCM back to vim --- vim/vimrc | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 54 insertions(+), 9 deletions(-) (limited to 'vim') diff --git a/vim/vimrc b/vim/vimrc index 9039f89..efdcc41 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -41,8 +41,8 @@ nnoremap ni :e $NOTES_DIR/index.md:cd $NOTES_DIR " clear search highlights nnoremap :noh:call clearmatches() nnoremap :FZF! -nnoremap p :Files -nnoremap g :GitFiles +nnoremap g :Files +nnoremap p :GitFiles nnoremap o :Tags nnoremap h :History nnoremap 0 :Files @@ -143,6 +143,7 @@ call plug#begin() Plug 'mattn/emmet-vim', Plug 'lambdalisue/fern.vim', Plug 'tpope/vim-rails', +Plug 'ycm-core/YouCompleteMe' Plug 'vim-ruby/vim-ruby', Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } Plug 'junegunn/fzf.vim' @@ -167,6 +168,18 @@ Plug 'honza/vim-snippets' Plug 'dense-analysis/ale' call plug#end() " }}} +" Snippets {{{ +" Trigger configuration. You need to change this to something other than +" if you use one of the following: +" - https://github.com/Valloric/YouCompleteMe +" - https://github.com/nvim-lua/completion-nvim +let g:UltiSnipsExpandTrigger="" +let g:UltiSnipsJumpForwardTrigger="" +let g:UltiSnipsJumpBackwardTrigger="" +let g:ycm_key_list_select_completion=[] +let g:ycm_key_list_previous_completion=[] +" +" }}} " {{{ emmet " being very explicit, which is not required autocmd FileType css imap html (emmet-expand-abbr) @@ -229,10 +242,10 @@ let g:ale_linters = {'python': ['pyright', 'flake8', 'mypy'], \} let g:ale_fixers = { \ 'python': ['autoimport', 'isort', 'yapf', 'black'], -\ 'javascript': ['eslint'], +\ 'javascript': ['eslint'], \ 'go': ['gofmt', 'goimports', 'gopls'], -\ 'cpp': ['clang-format'], -\ 'c': ['clang-format'], +\ 'cpp': ['clang-format'], +\ 'c': ['clang-format'], \ 'rust': ['rustfmt'] \ } let g:ale_python_mypy_ignore_invalid_syntax = 1 @@ -275,7 +288,7 @@ nmap tl :TestLast nmap tv :TestVisit let test#strategy = "basic" let test#python#pytest#options = '-q -s' -let test#python#runner = 'pytest' +let test#python#runner = 'django' let test#vimterminal#term_position = "belowright" " }}} " Titbits {{{ @@ -348,11 +361,13 @@ let g:gruvbox_contrast_dark = "hard" let g:gruvbox_italicize_strings = 1 let g:gruvbox_improved_strings = 1 let g:gruvbox_improved_warnings = 1 -let g:gruvbox_invert_indent_guides = 1 -let g:gruvbox_invert_signs = 1 +let g:gruvbox_invert_indent_guides = 0 +let g:gruvbox_invert_signs = 0 +let g:gruvbox_italic = 0 + "colorscheme evening "colorscheme sitruuna -colorscheme gruvbox +colorscheme ayu "colorscheme gruvbox " }}} " GPG files {{{ @@ -422,3 +437,33 @@ augroup end " Read man pages in vim {{{ runtime! ftplugin/man.vim " }}} +"" YouCompleteMe {{{ +"" -"" *** STARTING AND ENABLING *** +"" Don't start on start - or use show_diagnostics below +"let g:loaded_youcompleteme = 1 +"" with this set to 0, YCM doesn't load/start +"let g:ycm_show_diagnostics_ui = 1 +"" ****************************** +"let g:ycm_enable_inlay_hints = 1 +"nnoremap h (YCMToggleInlayHints) +"nnoremap gd :YcmCompleter GoToDefinition +"nnoremap gr :YcmCompleter GoToReferences +"nnoremap K :YcmCompleter GetDoc +"" this will disable tab, allowing it to be used for ultisnips +"" let g:ycm_key_list_select_completion=[] +"" let g:ycm_key_list_previous_completion=[] +"let g:ycm_key_list_select_completion = ['', ''] +"let g:ycm_key_list_previous_completion = ['', ''] +"let g:ycm_python_interpreter_path = '.venv/bin/python3' +"let g:ycm_auto_trigger = 1 +"let g:ycm_python_sys_path = [] +""let g:ycm_extra_conf_vim_data = [ +"" " \ 'g:ycm_python_interpreter_path', +"" " \ 'g:ycm_python_sys_path' +"" \] +""let g:ycm_global_ycm_extra_conf = '~/.global_extra_conf.py' +"nnoremap jd :YcmCompleter GoTo +"imap (YCMToggleSignatureHelp)'. + +"let g:ycm_enable_inlay_hints = 0 +"" }}} -- cgit v1.2.3