From e77bd44dceda6487e45d3dfcb65e351090396b03 Mon Sep 17 00:00:00 2001 From: Stefan Huber Date: Wed, 10 Jul 2024 13:54:58 +0200 Subject: [PATCH] plugins: Switch to mini.nvim Switch to plugin collection mini.nvim and remove now obsolete plugins like nerdtree, nerdcommenter, leap, which-key, easy-align, denite, signify, fugitive, and more. --- init.vim | 21 ------- keymaps.vim | 14 +---- plugins-full.vim.example | 112 +------------------------------------ plugins-local.vim.example | 2 +- plugins-midi.vim.example | 9 --- plugins-mini.vim | 113 +++++++++++++++++++++++++++----------- 6 files changed, 86 insertions(+), 185 deletions(-) diff --git a/init.vim b/init.vim index a01889a..c3f634b 100644 --- a/init.vim +++ b/init.vim @@ -89,27 +89,6 @@ augroup END " General settings -" Attention: Must be run after plugsetup.vim -" Trailing whitespace -highlight default link BadWhitespace SpellCap - -" Setup BadWhitespace syntax match expressions. -function SetBadWhitespaceSyntax() - " Do not expose bad whitespace in help buffers or for man pages. Or, more - " generally, if we open the file readonly. - "if &ft != "help" && &ft != "man" - if !&readonly - " Make trailing whitespace be flagged as bad. - syn match BadWhitespace /\s\+$/ containedin=ALL - " Make space before tab be flagged as bad and vice versa - syn match BadWhitespace / \+\t/ containedin=ALL - syn match BadWhitespace /\t \+/ containedin=ALL - endif -endfunction - -" Make trailing whitespace be flagged as bad. -au BufRead,BufNewFile * call SetBadWhitespaceSyntax() - " termdebug split windows let g:termdebug_wide = 1 let termdebugger = $HOME . '/.vim/gdb.sh' diff --git a/keymaps.vim b/keymaps.vim index 38f7774..4310e79 100644 --- a/keymaps.vim +++ b/keymaps.vim @@ -21,29 +21,19 @@ endif " ctrl+d as EOF exits shells and the like. Add a keymap for the same here. nnoremap :q -nnoremap :Denite file/rec -nnoremap / :Denite grep:. -nnoremap s :Denite buffer - nnoremap pumvisible() ? "\" : "\" -nnoremap :NERDTreeToggle +nnoremap :lua MiniFiles.open() nnoremap :TagbarToggle +nnoremap :lua MiniMap.toggle() nmap :bn nmap :bp -map NERDCommenterToggle - imap (neosnippet_expand_or_jump) smap (neosnippet_expand_or_jump) xmap (neosnippet_expand_target) -" Start interactive EasyAlign in visual mode (e.g. vipga) -vmap (EasyAlign) -" Start interactive EasyAlign for a motion/text object (e.g. gaip) -nmap ga (EasyAlign) - """""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Some filetype-specific settings diff --git a/plugins-full.vim.example b/plugins-full.vim.example index a4095e6..841d262 100644 --- a/plugins-full.vim.example +++ b/plugins-full.vim.example @@ -1,14 +1,3 @@ -if has('nvim') - Plug 'Shougo/deoplete.nvim', {'do': ':UpdateRemotePlugins'} - Plug 'Shougo/denite.nvim', { 'do': ':UpdateRemotePlugins' } -else - Plug 'Shougo/deoplete.nvim' - Plug 'Shougo/denite.nvim' - - Plug 'roxma/nvim-yarp' - Plug 'roxma/vim-hug-neovim-rpc' -endif - " java extension to deoplete Plug 'artur-shaik/vim-javacomplete2', {'for': 'java'} @@ -25,8 +14,6 @@ Plug 'lervag/vimtex' Plug 'shuber2/vim-syntax-easychair2' -Plug 'mhinz/vim-signify' -Plug 'tpope/vim-fugitive' Plug 'gko/vim-coloresque' Plug 'vimwiki/vimwiki' @@ -83,107 +70,11 @@ function PluginsConfigFull() call neomake#configure#automake('nw', 1000) endif - " Speedup deoplete startup time, see deoplete FAQ - let g:python3_host_prog = '/usr/bin/python3' - " deoplete requires huge startuptime. Delay loading upon first InsertEnter. - let g:deoplete#enable_at_startup = 0 - call deoplete#custom#option({ - \ 'smart_case' : v:true, - \ 'auto_refresh_delay' : 100, - \ }) - au InsertEnter * call deoplete#enable() - - " The denite settings are largely stolen from spacevim - let s:denite_options = { - \ 'default' : { - \ 'winheight' : 15, - \ 'mode' : 'insert', - \ 'start_filter' : 1, - \ 'quit' : 1, - \ 'highlight_matched_char' : 'MoreMsg', - \ 'highlight_matched_range' : 'MoreMsg', - \ 'direction': 'rightbelow', - \ }} - - augroup spacevim_layer_denite - autocmd! - autocmd FileType denite call s:denite_my_settings() - augroup END - - function! s:denite_my_settings() abort - nnoremap i - \ denite#do_map('open_filter_buffer') - nnoremap ' - \ denite#do_map('toggle_select').'j' - nnoremap q - \ denite#do_map('quit') - nnoremap - \ denite#do_map('do_action', 'tabopen') - nnoremap - \ denite#do_map('do_action', 'vsplit') - nnoremap - \ denite#do_map('do_action', 'split') - nnoremap - \ denite#do_map('do_action') - nnoremap p - \ denite#do_map('do_action', 'preview') - nnoremap j - nnoremap k - endfunction - - " FIND and GREP COMMANDS - if executable('rg') - " Ripgrep command on grep source - call denite#custom#var('grep', 'command', ['rg']) - call denite#custom#var('grep', 'default_opts', - \ ['--vimgrep', '--no-heading']) - call denite#custom#var('grep', 'recursive_opts', []) - call denite#custom#var('grep', 'pattern_opt', ['--regexp']) - call denite#custom#var('grep', 'separator', ['--']) - call denite#custom#var('grep', 'final_opts', []) - endif - - let s:insert_mode_mappings = [ - \ ['jk', '', 'noremap'], - \ ['', '', 'noremap'], - \ ['', '', 'noremap'], - \ ['', '', 'noremap'], - \ ['', '', 'noremap'], - \ ['', '', 'noremap'], - \ ['', '', 'noremap'], - \ ['', '', 'noremap'], - \ ['', '', 'noremap'], - \ ['', '', 'noremap'], - \ ['', '', 'noremap'], - \ ['', '', 'noremap'], - \ ['', '', 'noremap'], - \ ['', '', 'noremap'], - \ ] - - let s:normal_mode_mappings = [ - \ ["'", '', 'noremap'], - \ ['', '', 'noremap'], - \ ['', '', 'noremap'], - \ ['', '', 'noremap'], - \ ['', '', 'noremap'], - \ ['', '', 'noremap'], - \ ['', '', 'noremap'], - \ ['gg', '', 'noremap'], - \ ['', '', 'noremap'], - \ ['', '', 'noremap'], - \ ['', '', 'noremap'], - \ ['q', '', 'noremap'], - \ ['r', '', 'noremap'], - \ ] - - " Have deoplete completion for vimtex (e.g., bibtex entries) - au Filetype tex call deoplete#custom#var('omni', 'input_patterns', { - \ 'tex': g:vimtex#re#deoplete }) if has('nvim-0.5') set foldexpr=nvim_treesitter#foldexpr() -lua <cf :ClangFormat augroup END - endfunction diff --git a/plugins-local.vim.example b/plugins-local.vim.example index b7c7a73..997b387 100644 --- a/plugins-local.vim.example +++ b/plugins-local.vim.example @@ -2,7 +2,7 @@ "Plug 'chikamichi/mediawiki.vim' -function PluginsLocalConfig() +function PluginsConfigLocal() " Reduce load on memory by updating one plugin at a time "let g:plug_threads = 1 diff --git a/plugins-midi.vim.example b/plugins-midi.vim.example index ca75f17..a024726 100644 --- a/plugins-midi.vim.example +++ b/plugins-midi.vim.example @@ -4,13 +4,11 @@ Plug 'jamessan/vim-gnupg' " Conditional loading does not work, see github issue #823 Plug 'ludovicchabant/vim-gutentags' -"Plug 'vim-scripts/Conque-GDB', {'for': ['c', 'cpp', 'objc']} Plug 'editorconfig/editorconfig-vim' Plug 'embear/vim-localvimrc' Plug 'airblade/vim-rooter' -Plug 'Xuyuanp/nerdtree-git-plugin', {'on': 'NERDTreeToggle'} Plug 'plasticboy/vim-markdown', {'for': 'markdown'} Plug 'lvht/tagbar-markdown', {'for': 'markdown'} @@ -29,7 +27,6 @@ Plug 'mattn/calendar-vim' Plug 'vim-scripts/loremipsum', {'on': 'Loremipsum'} -Plug 'ggandor/leap.nvim' function PluginsConfigMidi() let g:localvimrc_persistent = 1 @@ -66,10 +63,4 @@ function PluginsConfigMidi() let g:vim_markdown_auto_insert_bullets = 0 let g:calendar_monday = 1 - - if has('nvim-0.5') -lua < :WhichKey '' - nnoremap :WhichKey ',' - vnoremap :WhichKeyVisual '' - vnoremap :WhichKeyVisual ',' - - let g:which_key_map = {} - au VimEnter * call which_key#register('', 'g:which_key_map') - let g:which_key_map.b = { - \ 'name': '+buffer', - \ '1': ['b1', 'buffer 1'], - \ '2': ['b2', 'buffer 2'], - \ 'd': ['bd', 'delete-buffer'], - \ 'f': ['bfirst', 'first-buffer'], - \ 'h': ['Startify', 'home-buffer'], - \ 'l': ['blast', 'last-buffer'], - \ 'n': ['bnext', 'next-buffer'], - \ 'p': ['bprevious', 'previous-buffer'], - \ } + + if has('nvim-0.7') + lua < mapping groups + miniclue.gen_clues.builtin_completion(), + miniclue.gen_clues.g(), + miniclue.gen_clues.marks(), + miniclue.gen_clues.registers(), + miniclue.gen_clues.windows(), + miniclue.gen_clues.z(), + }, + }) +EOF + endif endfunction -- 2.39.5