From: Stefan Huber Date: Wed, 22 Dec 2021 09:19:51 +0000 (+0100) Subject: plugins: Merge init files into plugin files X-Git-Url: https://git.sthu.org/?p=vimconf.git;a=commitdiff_plain;h=d768c759620dfbc8caa54bbb65ff784067057546 plugins: Merge init files into plugin files --- diff --git a/init-local.vim.example b/init-local.vim.example deleted file mode 100644 index 155438e..0000000 --- a/init-local.vim.example +++ /dev/null @@ -1,27 +0,0 @@ -" Do not show diagnostic window of vim-clang -let g:clang_diagsopt = '' - -let g:ConqueTerm_StartMessages = 0 - -" Reduce load on memory by updating one plugin at a time -"let g:plug_threads = 1 - -" Configuration for youcompleteme, if not using vim-clang. -"let g:ycm_global_ycm_extra_conf = '~/.ycm_extra_conf.py' -"let g:ycm_confirm_extra_conf = 0 -"let g:ycm_min_num_of_chars_for_completion = 2 -"let g:ycm_collect_identifiers_from_tags_files = 1 -"let g:ycm_autoclose_preview_window_after_completion = 1 -"let g:ycm_key_list_select_completion = [''] -"nnoremap jd :YcmCompleter GoToDefinitionElseDeclaration -"let g:ycm_filetype_whitelist = { 'c' : 1, 'cpp' : 1, 'cs' : 1, 'objc' : 1, 'java' : 1, 'python' : 1 } - -" Some terminals, like konsole, cause weired symbols (e.g., q) printed due to -" broken cursor-shape termcodes. -if has('nvim') - set guicursor= - " Workaround some broken plugins which set guicursor indiscriminately. - au OptionSet guicursor noautocmd set guicursor= -end - -" vim:ft=vim diff --git a/init-plugins-noroot-nolowendbox.vim b/init-plugins-noroot-nolowendbox.vim deleted file mode 100644 index 31b2a89..0000000 --- a/init-plugins-noroot-nolowendbox.vim +++ /dev/null @@ -1,132 +0,0 @@ -" 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 <'] + "nnoremap jd :YcmCompleter GoToDefinitionElseDeclaration + "let g:ycm_filetype_whitelist = { 'c' : 1, 'cpp' : 1, 'cs' : 1, 'objc' : 1, 'java' : 1, 'python' : 1 } + + " Some terminals, like konsole, cause weired symbols (e.g., q) printed due to + " broken cursor-shape termcodes. + if has('nvim') + set guicursor= + " Workaround some broken plugins which set guicursor indiscriminately. + au OptionSet guicursor noautocmd set guicursor= + end +endfunction + +" vim:ft=vim diff --git a/plugins-noroot-nolowendbox.vim b/plugins-noroot-nolowendbox.vim index 93d01f3..4c9c4d7 100644 --- a/plugins-noroot-nolowendbox.vim +++ b/plugins-noroot-nolowendbox.vim @@ -45,3 +45,139 @@ if has('nvim-0.5') else Plug 'sheerun/vim-polyglot' endif + + +function PluginsNorootNolowendboxConfig() + + " 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 <