From fa54f7fdbcb6b3674073afde0cc121f47ba145fa Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Thu, 13 Apr 2023 17:53:49 +0100 Subject: [PATCH] vim: put all nvim disabled plugins together --- vim/vimrc | 191 +++++++++++++++++++++++++----------------------------- 1 file changed, 87 insertions(+), 104 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index df8e279..6cc50e7 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -13,6 +13,92 @@ call plug#begin('$XDG_DATA_HOME/vim') " This does not update vim-plug, use PlugUpgrade instead Plug 'junegunn/vim-plug' +if !has("nvim") + Plug 'bling/vim-airline' " {{{2 + let g:airline#extensions#whitespace#enabled = 1 + let g:airline#extensions#tabline#enabled = 1 + let g:airline#extensions#searchcount#enabled = 0 + let g:airline_powerline_fonts = 1 + + let g:asyncrun_status = "stopped" + " let g:airline_section_error = airline#section#create_right(['%{g:asyncrun_status}']) + "}}} + Plug 'raimondi/delimitmate' " {{{2 + let delimitMate_expand_cr = 2 + let g:delimitMate_expand_space = 1 + "}}} + Plug 'tpope/vim-surround' "{{{2 + "}}} + " Plug 'valloric/youcompleteme' {{{2 + Plug 'valloric/youcompleteme', + \{ 'do': './install.py --clangd-completer --clang-completer' } + let g:ycm_clangd_binary_path = 'clangd' " use clangd in path + let g:ycm_clangd_args = ['--clang-tidy'] + let g:ycm_extra_conf_vim_data = ['getcwd()'] + let g:ycm_add_preview_to_completeopt = 1 + let g:ycm_complete_in_comments = 1 + let g:ycm_complete_in_strings = 1 + let g:ycm_autoclose_preview_window_after_insertion = 0 + + let g:ycm_language_server = + \ [ + \ { + \ 'name': 'haskell', + \ 'cmdline': [ 'haskell-language-server-wrapper', '--lsp' ], + \ 'filetypes': [ 'haskell', 'lhaskell' ] + \ }, + \ ] + " }}} + Plug 'svermeulen/vim-yoink' " {{{2 + ""}}} + Plug 'arcticicestudio/nord-vim' " {{{2 + let g:nord_bold = 1 + let g:nord_italic = 1 + let g:nord_italic_comments = 1 + let g:nord_underline = 1 + let g:nord_uniform_status_lines = 0 + let g:nord_uniform_diff_background = 0 + let g:nord_cursor_line_number_background = 0 + let g:nord_bold_vertical_split_line = 0 + "}}} + Plug 'sirver/ultisnips' " {{{2 + Plug 'honza/vim-snippets' + let g:UltiSnipsEditSplit = 'vertical' + let g:UltiSnipsSnippetDirectories = [ expand("$XDG_CONFIG_HOME/vim/ultisnips") ] + if has('fname_case') + let g:UltiSnipsSnippetDirectories = ["UltiSnips", "ultisnips"] + endif + let g:UltiSnipsExpandTrigger = "" + let g:UltiSnipsJumpForwardTrigger = "" + let g:UltiSnipsJumpBackwardTrigger = "" + + " UltiSnips completion function that tries to expand a snippet. If there's no + " snippet for expanding, it checks for completion window and if it's shown, + " selects first element. If there's no completion window it tries to jump to + " next placeholder. If there's no placeholder it just returns TAB key + " https://github.com/Valloric/YouCompleteMe/issues/36#issuecomment-15451411 + function! g:UltiSnips_Complete() + call UltiSnips#ExpandSnippet() + if g:ulti_expand_res == 0 + if pumvisible() + return "\" + else + call UltiSnips#JumpForwards() + if g:ulti_jump_forwards_res == 0 + return "\" + endif + endif + endif + return "" + endfunction + au InsertEnter * exec "inoremap " . g:UltiSnipsExpandTrigger . " =g:UltiSnips_Complete()" + let g:UltiSnipsListSnippets="" + "}}} + Plug 'vim-utils/vim-man' " {{{2 + let g:man_width = 80 + "}}} +endif + Plug 'airblade/vim-gitgutter' " {{{ " prefer other signs such as ycm diags let g:gitgutter_sign_priority = 1 @@ -26,18 +112,6 @@ nnoremap ,h :SidewaysLeft:delmarks z nnoremap ,l :SidewaysRight:delmarks z "}}} Plug 'andrewradev/switch.vim' -if !has('nvim') - Plug 'bling/vim-airline' "{{{2 - let g:airline#extensions#whitespace#enabled = 1 - let g:airline#extensions#tabline#enabled = 1 - let g:airline#extensions#searchcount#enabled = 0 - let g:airline_powerline_fonts = 1 - - let g:asyncrun_status = "stopped" - " let g:airline_section_error = airline#section#create_right(['%{g:asyncrun_status}']) - "}}} -endif - Plug 'chrisbra/checkattach' Plug 'derekwyatt/vim-fswitch' Plug 'elzr/vim-json' @@ -48,12 +122,6 @@ Plug 'klen/python-mode' Plug 'kshenoy/vim-signature' Plug 'majutsushi/tagbar' Plug 'octol/vim-cpp-enhanced-highlight' -if !has('nvim') - Plug 'raimondi/delimitmate' " {{{2 - let delimitMate_expand_cr = 2 - let g:delimitMate_expand_space = 1 - "}}} -end Plug 'sgeb/vim-diff-fold' Plug 'skywind3000/asyncrun.vim' " {{{2 command! -bang -nargs=* -complete=file Make AsyncRun -save=2 -program=make @ @@ -72,38 +140,10 @@ Plug 'tpope/vim-fugitive' Plug 'tpope/vim-repeat' Plug 'tpope/vim-scriptease' Plug 'tpope/vim-speeddating' -if !has('nvim') - Plug 'tpope/vim-surround' "investigate vim-sandwich -endif Plug 'tpope/vim-unimpaired' Plug 'tweekmonster/spellrotate.vim' -if !has("nvim") - " Plug 'valloric/youcompleteme' {{{2 - Plug 'valloric/youcompleteme', - \{ 'do': './install.py --clangd-completer --clang-completer' } - let g:ycm_clangd_binary_path = 'clangd' " use clangd in path - let g:ycm_clangd_args = ['--clang-tidy'] - let g:ycm_extra_conf_vim_data = ['getcwd()'] - let g:ycm_add_preview_to_completeopt = 1 - let g:ycm_complete_in_comments = 1 - let g:ycm_complete_in_strings = 1 - let g:ycm_autoclose_preview_window_after_insertion = 0 - - let g:ycm_language_server = - \ [ - \ { - \ 'name': 'haskell', - \ 'cmdline': [ 'haskell-language-server-wrapper', '--lsp' ], - \ 'filetypes': [ 'haskell', 'lhaskell' ] - \ }, - \ ] - " }}} -endif Plug 'vim-scripts/mediawiki.vim' Plug 'vim-scripts/replacewithregister' -if !has('nvim') - Plug 'svermeulen/vim-yoink' -end Plug 'wincent/loupe' " colorschemes @@ -111,57 +151,6 @@ Plug 'morhetz/gruvbox' " {{{2 let g:gruvbox_contrast_dark = 'hard' let g:gruvbox_contrast_light = 'soft' -if !has('nvim') - Plug 'arcticicestudio/nord-vim' " {{{2 - let g:nord_bold = 1 - let g:nord_italic = 1 - let g:nord_italic_comments = 1 - let g:nord_underline = 1 - let g:nord_uniform_status_lines = 0 - let g:nord_uniform_diff_background = 0 - let g:nord_cursor_line_number_background = 0 - let g:nord_bold_vertical_split_line = 0 -endif - -"}}} - -if !has("nvim") - Plug 'sirver/ultisnips' " {{{ - Plug 'honza/vim-snippets' - - let g:UltiSnipsEditSplit = 'vertical' - let g:UltiSnipsSnippetDirectories = [ expand("$XDG_CONFIG_HOME/vim/ultisnips") ] - if has('fname_case') - let g:UltiSnipsSnippetDirectories = ["UltiSnips", "ultisnips"] - endif - let g:UltiSnipsExpandTrigger = "" - let g:UltiSnipsJumpForwardTrigger = "" - let g:UltiSnipsJumpBackwardTrigger = "" - - " UltiSnips completion function that tries to expand a snippet. If there's no - " snippet for expanding, it checks for completion window and if it's shown, - " selects first element. If there's no completion window it tries to jump to - " next placeholder. If there's no placeholder it just returns TAB key - " https://github.com/Valloric/YouCompleteMe/issues/36#issuecomment-15451411 - function! g:UltiSnips_Complete() - call UltiSnips#ExpandSnippet() - if g:ulti_expand_res == 0 - if pumvisible() - return "\" - else - call UltiSnips#JumpForwards() - if g:ulti_jump_forwards_res == 0 - return "\" - endif - endif - endif - return "" - endfunction - au InsertEnter * exec "inoremap " . g:UltiSnipsExpandTrigger . " =g:UltiSnips_Complete()" - let g:UltiSnipsListSnippets="" -"}}} -endif - " text objects Plug 'kana/vim-textobj-user' Plug 'julian/vim-textobj-variable-segment' @@ -211,17 +200,11 @@ Plug 'mtth/scratch.vim' " {{{2 let g:scratch_autohide = 0 "}}} -let g:man_hardwrap = 80 -if !has('nvim') - Plug 'vim-utils/vim-man' " {{{2 - let g:man_width = 80 -"}}} -endif - Plug 'jenterkin/vim-autosource' " {{{2 let g:autosource_hashdir = $XDG_CACHE_HOME . '/vim/vim-autosource' let g:autosource_conf_names = ['.vimrc', '.vimrc.lua'] "}}} + call plug#end() filetype plugin indent on -- 2.48.1