diff options
author | Matthew Lemon <y@yulqen.org> | 2024-05-22 09:07:35 +0100 |
---|---|---|
committer | Matthew Lemon <y@yulqen.org> | 2024-05-22 09:07:35 +0100 |
commit | 2310730e3fd4dbb72ac89b15b2947db89c153123 (patch) | |
tree | efeab3e31e4682a15528ce289c4f639ec79d8295 /vim | |
parent | c9db27caa5cdb459e6122e38fc494f169c068ee5 (diff) |
Mainly adds YCM back to vim
Diffstat (limited to 'vim')
-rw-r--r-- | vim/vimrc | 63 |
1 files changed, 54 insertions, 9 deletions
@@ -41,8 +41,8 @@ nnoremap <leader>ni :e $NOTES_DIR/index.md<CR>:cd $NOTES_DIR<CR> " clear search highlights nnoremap <leader><space> :noh<cr>:call clearmatches()<cr> nnoremap <leader><C-p> :<C-u>FZF!<CR> -nnoremap <C-p>p :Files<CR> -nnoremap <C-p>g :GitFiles<CR> +nnoremap <C-p>g :Files<CR> +nnoremap <C-p>p :GitFiles<CR> nnoremap <leader>o :Tags<CR> nnoremap <leader>h :History<CR> nnoremap <silent> <leader>0 :Files<CR> @@ -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 +"<tab> if you use one of the following: +" - https://github.com/Valloric/YouCompleteMe +" - https://github.com/nvim-lua/completion-nvim +let g:UltiSnipsExpandTrigger="<S-t>" +let g:UltiSnipsJumpForwardTrigger="<S-f>" +let g:UltiSnipsJumpBackwardTrigger="<S-b>" +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 <tab> <plug>(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 <silent> tl :TestLast<CR> nmap <silent> <leader>tv :TestVisit<CR> 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 <silent> <localleader>h <Plug>(YCMToggleInlayHints) +"nnoremap gd :YcmCompleter GoToDefinition<CR> +"nnoremap <leader>gr :YcmCompleter GoToReferences<CR> +"nnoremap K :YcmCompleter GetDoc<CR> +"" 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 = ['<C-n>', '<Down>'] +"let g:ycm_key_list_previous_completion = ['<C-p>', '<Up>'] +"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 <leader>jd :YcmCompleter GoTo<CR> +"imap <silent> <C-l> <Plug>(YCMToggleSignatureHelp)'. + +"let g:ycm_enable_inlay_hints = 0 +"" }}} |