+++ /dev/null
-" 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 = ['<Down>']
-"nnoremap <buffer> <leader>jd :YcmCompleter GoToDefinitionElseDeclaration<CR>
-"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
+++ /dev/null
-" 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 <silent><buffer><expr> i
- \ denite#do_map('open_filter_buffer')
- nnoremap <silent><buffer><expr> '
- \ denite#do_map('toggle_select').'j'
- nnoremap <silent><buffer><expr> q
- \ denite#do_map('quit')
- nnoremap <silent><buffer><expr> <C-t>
- \ denite#do_map('do_action', 'tabopen')
- nnoremap <silent><buffer><expr> <C-v>
- \ denite#do_map('do_action', 'vsplit')
- nnoremap <silent><buffer><expr> <C-s>
- \ denite#do_map('do_action', 'split')
- nnoremap <silent><buffer><expr> <CR>
- \ denite#do_map('do_action')
- nnoremap <silent><buffer><expr> p
- \ denite#do_map('do_action', 'preview')
- nnoremap <silent><buffer><Tab> j
- nnoremap <silent><buffer><S-Tab> 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', '<denite:enter_mode:normal>', 'noremap'],
- \ ['<Tab>', '<denite:move_to_next_line>', 'noremap'],
- \ ['<C-j>', '<denite:move_to_next_line>', 'noremap'],
- \ ['<S-tab>', '<denite:move_to_previous_line>', 'noremap'],
- \ ['<C-k>', '<denite:move_to_previous_line>', 'noremap'],
- \ ['<C-t>', '<denite:do_action:tabopen>', 'noremap'],
- \ ['<C-v>', '<denite:do_action:vsplit>', 'noremap'],
- \ ['<C-s>', '<denite:do_action:split>', 'noremap'],
- \ ['<Esc>', '<denite:enter_mode:normal>', 'noremap'],
- \ ['<C-N>', '<denite:assign_next_matched_text>', 'noremap'],
- \ ['<C-P>', '<denite:assign_previous_matched_text>', 'noremap'],
- \ ['<Up>', '<denite:assign_previous_text>', 'noremap'],
- \ ['<Down>', '<denite:assign_next_text>', 'noremap'],
- \ ['<C-Y>', '<denite:redraw>', 'noremap'],
- \ ]
-
-let s:normal_mode_mappings = [
- \ ["'", '<denite:toggle_select_down>', 'noremap'],
- \ ['<C-n>', '<denite:jump_to_next_source>', 'noremap'],
- \ ['<C-p>', '<denite:jump_to_previous_source>', 'noremap'],
- \ ['<Tab>', '<denite:move_to_next_line>', 'noremap'],
- \ ['<C-j>', '<denite:move_to_next_line>', 'noremap'],
- \ ['<S-tab>', '<denite:move_to_previous_line>', 'noremap'],
- \ ['<C-k>', '<denite:move_to_previous_line>', 'noremap'],
- \ ['gg', '<denite:move_to_first_line>', 'noremap'],
- \ ['<C-t>', '<denite:do_action:tabopen>', 'noremap'],
- \ ['<C-v>', '<denite:do_action:vsplit>', 'noremap'],
- \ ['<C-s>', '<denite:do_action:split>', 'noremap'],
- \ ['q', '<denite:quit>', 'noremap'],
- \ ['r', '<denite:redraw>', '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 <<EOF
- require'nvim-treesitter.configs'.setup {
- -- one of "all", "maintained" (parsers with maintainers), or a list of languages
- ensure_installed = "maintained",
- -- List of parsers to ignore installing
- ignore_install = {},
- -- Modules and its options go here
- highlight = { enable = true },
- -- Indentation is still quite buggy, e.g., for multi-line C comments
- -- or for comments right after a preproc definition.
- -- indent = { enable = true },
- textobjects = { enable = true },
- incremental_selection = {
- enable = true,
- keymaps = {
- init_selection = "gnn",
- node_incremental = "grn",
- scope_incremental = "grc",
- node_decremental = "grm",
- },
- },
- refactor = {
- highlight_definitions = { enable = true },
- smart_rename = {
- enable = true,
- keymaps = { smart_rename = "grr" },
- },
- navigation = {
- enable = true,
- keymaps = {
- goto_definition = "gnd",
- list_definitions = "gnD",
- list_definitions_toc = "gO",
- goto_next_usage = "<a-*>",
- goto_previous_usage = "<a-#>",
- },
- },
- },
- }
-EOF
-
-endif
+++ /dev/null
-if g:lowendbox == 0
- source ~/.vim/init-plugins-noroot-nolowendbox.vim
-endif
+++ /dev/null
-let g:localvimrc_persistent = 1
-
-let g:fastfold_minlines = 0
-
-au FileType markdown call RagtagInit()
-
-let g:detectspelllang_langs = {}
-let g:detectspelllang_langs.aspell =[ 'en_US', 'de_AT']
-au FileType mail let g:VimMailSpellLangs=['de', 'en']
-
-let g:org_todo_keywords = [['TODO(t)', 'WAITING(w)', '|', 'DONE(d)'],
- \ ['|', 'OBSOLETE(o)', 'WONT(n)'],
- \ ['CANCELED(c)']]
-
-let g:vimwiki_list = [{'path': '~/.vimwiki/',
- \ 'template_path': '~/.vim/vimwiki/templates',
- \ 'template_default': 'default',
- \ 'template_ext': '.html'}]
-let g:vimwiki_global_ext = 0
-
-" Java completion
-au FileType java setlocal omnifunc=javacomplete#Complete
-au FileType java JCEnable
-
-let g:VimMailContactsProvider=['khard']
-let g:VimMailContactsCommands={
- \'khard':
- \{ 'query' : "khard email --parsable --search-in-source-files",
- \'sync': "/bin/true"}
- \}
-
-let g:vimtex_fold_enabled = 1
-let g:vimtex_fold_levelmarker = '➜'
-
-" termdebug split windows
-let g:termdebug_wide = 1
-let termdebugger = $HOME . '/.vim/gdb.sh'
-
-let g:startify_files_number = 5
-let g:startify_session_persistence = 1
-let g:startify_lists = [
- \ { 'type': 'dir', 'header': [' Recent files'] },
- \ { 'type': 'sessions', 'header': [' Saved sessions'] },
- \ ]
-
-if has('nvim')
- let verstr = matchstr(execute('version'), 'NVIM v\zs[^\n]*')
- let g:startify_custom_header = [
- \ '',
- \ ' ╻ ╻ ╻ ┏┳┓',
- \ ' NEO ┃┏┛ ┃ ┃┃┃',
- \ ' ┗┛ ╹ ╹ ╹ ' . verstr,
- \ '',
- \ ]
-else
- let verstr = matchstr(execute('version'), 'IMproved \zs[^\n ]*')
- let g:startify_custom_header = [
- \ '',
- \ ' ╻ ╻ ╻ ┏┳┓',
- \ ' ┃┏┛ ┃ ┃┃┃',
- \ ' ┗┛ ╹ ╹ ╹ ' . verstr,
- \ '',
- \ ]
-endif
-
-
-if $USER != "root"
- source ~/.vim/init-plugins-noroot.vim
-endif
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-" Some plugin-specific settings
-
-source ~/.vim/init-plugins.vim
+" Some global keymaps
runtime keymaps.vim
-
-if filereadable($HOME . '/.vim/init-local.vim')
- source ~/.vim/init-local.vim
-endif
"Plug 'kien/tabman.vim'
"Plug 'chikamichi/mediawiki.vim'
+
+function PluginsLocalConfig()
+ " 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 = ['<Down>']
+ "nnoremap <buffer> <leader>jd :YcmCompleter GoToDefinitionElseDeclaration<CR>
+ "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
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 <silent><buffer><expr> i
+ \ denite#do_map('open_filter_buffer')
+ nnoremap <silent><buffer><expr> '
+ \ denite#do_map('toggle_select').'j'
+ nnoremap <silent><buffer><expr> q
+ \ denite#do_map('quit')
+ nnoremap <silent><buffer><expr> <C-t>
+ \ denite#do_map('do_action', 'tabopen')
+ nnoremap <silent><buffer><expr> <C-v>
+ \ denite#do_map('do_action', 'vsplit')
+ nnoremap <silent><buffer><expr> <C-s>
+ \ denite#do_map('do_action', 'split')
+ nnoremap <silent><buffer><expr> <CR>
+ \ denite#do_map('do_action')
+ nnoremap <silent><buffer><expr> p
+ \ denite#do_map('do_action', 'preview')
+ nnoremap <silent><buffer><Tab> j
+ nnoremap <silent><buffer><S-Tab> 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', '<denite:enter_mode:normal>', 'noremap'],
+ \ ['<Tab>', '<denite:move_to_next_line>', 'noremap'],
+ \ ['<C-j>', '<denite:move_to_next_line>', 'noremap'],
+ \ ['<S-tab>', '<denite:move_to_previous_line>', 'noremap'],
+ \ ['<C-k>', '<denite:move_to_previous_line>', 'noremap'],
+ \ ['<C-t>', '<denite:do_action:tabopen>', 'noremap'],
+ \ ['<C-v>', '<denite:do_action:vsplit>', 'noremap'],
+ \ ['<C-s>', '<denite:do_action:split>', 'noremap'],
+ \ ['<Esc>', '<denite:enter_mode:normal>', 'noremap'],
+ \ ['<C-N>', '<denite:assign_next_matched_text>', 'noremap'],
+ \ ['<C-P>', '<denite:assign_previous_matched_text>', 'noremap'],
+ \ ['<Up>', '<denite:assign_previous_text>', 'noremap'],
+ \ ['<Down>', '<denite:assign_next_text>', 'noremap'],
+ \ ['<C-Y>', '<denite:redraw>', 'noremap'],
+ \ ]
+
+ let s:normal_mode_mappings = [
+ \ ["'", '<denite:toggle_select_down>', 'noremap'],
+ \ ['<C-n>', '<denite:jump_to_next_source>', 'noremap'],
+ \ ['<C-p>', '<denite:jump_to_previous_source>', 'noremap'],
+ \ ['<Tab>', '<denite:move_to_next_line>', 'noremap'],
+ \ ['<C-j>', '<denite:move_to_next_line>', 'noremap'],
+ \ ['<S-tab>', '<denite:move_to_previous_line>', 'noremap'],
+ \ ['<C-k>', '<denite:move_to_previous_line>', 'noremap'],
+ \ ['gg', '<denite:move_to_first_line>', 'noremap'],
+ \ ['<C-t>', '<denite:do_action:tabopen>', 'noremap'],
+ \ ['<C-v>', '<denite:do_action:vsplit>', 'noremap'],
+ \ ['<C-s>', '<denite:do_action:split>', 'noremap'],
+ \ ['q', '<denite:quit>', 'noremap'],
+ \ ['r', '<denite:redraw>', '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 <<EOF
+ require'nvim-treesitter.configs'.setup {
+ -- one of "all", "maintained" (parsers with maintainers), or a list of languages
+ ensure_installed = "maintained",
+ -- List of parsers to ignore installing
+ ignore_install = {},
+ -- Modules and its options go here
+ highlight = { enable = true },
+ -- Indentation is still quite buggy, e.g., for multi-line C comments
+ -- or for comments right after a preproc definition.
+ -- indent = { enable = true },
+ textobjects = { enable = true },
+ incremental_selection = {
+ enable = true,
+ keymaps = {
+ init_selection = "gnn",
+ node_incremental = "grn",
+ scope_incremental = "grc",
+ node_decremental = "grm",
+ },
+ },
+ refactor = {
+ highlight_definitions = { enable = true },
+ smart_rename = {
+ enable = true,
+ keymaps = { smart_rename = "grr" },
+ },
+ navigation = {
+ enable = true,
+ keymaps = {
+ goto_definition = "gnd",
+ list_definitions = "gnD",
+ list_definitions_toc = "gO",
+ goto_next_usage = "<a-*>",
+ goto_previous_usage = "<a-#>",
+ },
+ },
+ },
+ }
+EOF
+ endif
+endfunction
Plug 'vim-scripts/loremipsum', {'on': 'Loremipsum'}
-if g:lowendbox == 0
- source ~/.vim/plugins-noroot-nolowendbox.vim
-endif
+
+function PluginsNorootConfig()
+endfunction
Plug 'flwyd/vim-conjoin'
-if $USER != "root"
- source ~/.vim/plugins-noroot.vim
-endif
-if filereadable($HOME . '/.vim/plugins-local.vim')
- source ~/.vim/plugins-local.vim
-endif
+function PluginsConfig()
+ let g:localvimrc_persistent = 1
+
+ let g:fastfold_minlines = 0
+
+ au FileType markdown call RagtagInit()
+
+ let g:detectspelllang_langs = {}
+ let g:detectspelllang_langs.aspell =[ 'en_US', 'de_AT']
+ au FileType mail let g:VimMailSpellLangs=['de', 'en']
+
+ let g:org_todo_keywords = [['TODO(t)', 'WAITING(w)', '|', 'DONE(d)'],
+ \ ['|', 'OBSOLETE(o)', 'WONT(n)'],
+ \ ['CANCELED(c)']]
+
+ let g:vimwiki_list = [{'path': '~/.vimwiki/',
+ \ 'template_path': '~/.vim/vimwiki/templates',
+ \ 'template_default': 'default',
+ \ 'template_ext': '.html'}]
+ let g:vimwiki_global_ext = 0
+
+ " Java completion
+ au FileType java setlocal omnifunc=javacomplete#Complete
+ au FileType java JCEnable
+
+ let g:VimMailContactsProvider=['khard']
+ let g:VimMailContactsCommands={
+ \'khard':
+ \{ 'query' : "khard email --parsable --search-in-source-files",
+ \'sync': "/bin/true"}
+ \}
+
+ let g:vimtex_fold_enabled = 1
+ let g:vimtex_fold_levelmarker = '➜'
+
+ " termdebug split windows
+ let g:termdebug_wide = 1
+ let termdebugger = $HOME . '/.vim/gdb.sh'
+
+ let g:startify_files_number = 5
+ let g:startify_session_persistence = 1
+ let g:startify_lists = [
+ \ { 'type': 'dir', 'header': [' Recent files'] },
+ \ { 'type': 'sessions', 'header': [' Saved sessions'] },
+ \ ]
+
+ if has('nvim')
+ let verstr = matchstr(execute('version'), 'NVIM v\zs[^\n]*')
+ let g:startify_custom_header = [
+ \ '',
+ \ ' ╻ ╻ ╻ ┏┳┓',
+ \ ' NEO ┃┏┛ ┃ ┃┃┃',
+ \ ' ┗┛ ╹ ╹ ╹ ' . verstr,
+ \ '',
+ \ ]
+ else
+ let verstr = matchstr(execute('version'), 'IMproved \zs[^\n ]*')
+ let g:startify_custom_header = [
+ \ '',
+ \ ' ╻ ╻ ╻ ┏┳┓',
+ \ ' ┃┏┛ ┃ ┃┃┃',
+ \ ' ┗┛ ╹ ╹ ╹ ' . verstr,
+ \ '',
+ \ ]
+ endif
+endfunction
+
autocmd VimEnter * PlugInstall --sync | source ~/.vim/init.vim
endif
+
call plug#begin('~/.vim/plugged')
+
source ~/.vim/plugins.vim
+
+" Load various conditinoal plugin sets
+if filereadable($HOME . '/.vim/plugins-local.vim')
+ source ~/.vim/plugins-local.vim
+endif
+
+if $USER != "root"
+ source ~/.vim/plugins-noroot.vim
+
+ if g:lowendbox == 0
+ source ~/.vim/plugins-noroot-nolowendbox.vim
+ endif
+endif
+
call plug#end()
-"Automatically install missing plugins
-"https://github.com/junegunn/vim-plug/wiki/extra
-autocmd VimEnter *
- \ if len(filter(values(g:plugs), '!isdirectory(v:val.dir)'))
- \| PlugInstall --sync | q
- \| endif
+
+" Call the config functions of the plugins
+call PluginsConfig()
+if filereadable($HOME . '/.vim/plugins-local.vim')
+ call PluginsLocalConfig()
+endif
+if $USER != "root"
+ call PluginsNorootConfig()
+ if g:lowendbox == 0
+ call PluginsNorootNolowendboxConfig()
+ endif
+endif
+
+
+function s:PostConfig()
+ "Automatically install missing plugins
+ "https://github.com/junegunn/vim-plug/wiki/extra
+ if len(filter(values(g:plugs), '!isdirectory(v:val.dir)'))
+ PlugInstall --sync | q
+ endif
+endfunction
+
+autocmd VimEnter * call s:PostConfig()