]> git.sthu.org Git - vimconf.git/commitdiff
plugins: Merge init files into plugin files
authorStefan Huber <shuber@sthu.org>
Wed, 22 Dec 2021 09:19:51 +0000 (10:19 +0100)
committerStefan Huber <shuber@sthu.org>
Wed, 22 Dec 2021 09:19:51 +0000 (10:19 +0100)
init-local.vim.example [deleted file]
init-plugins-noroot-nolowendbox.vim [deleted file]
init-plugins-noroot.vim [deleted file]
init-plugins.vim [deleted file]
init.vim
plugins-local.vim.example
plugins-noroot-nolowendbox.vim
plugins-noroot.vim
plugins.vim
plugsetup.vim

diff --git a/init-local.vim.example b/init-local.vim.example
deleted file mode 100644 (file)
index 155438e..0000000
+++ /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 = ['<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
diff --git a/init-plugins-noroot-nolowendbox.vim b/init-plugins-noroot-nolowendbox.vim
deleted file mode 100644 (file)
index 31b2a89..0000000
+++ /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 <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
diff --git a/init-plugins-noroot.vim b/init-plugins-noroot.vim
deleted file mode 100644 (file)
index 25bb623..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-if g:lowendbox == 0
-    source ~/.vim/init-plugins-noroot-nolowendbox.vim
-endif
diff --git a/init-plugins.vim b/init-plugins.vim
deleted file mode 100644 (file)
index 8aba3b8..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-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
index 74aa3d385fc52b0c583d400f5d08f873914486ec..88538fda15c2561061c6a7e89b32518fb694b9bc 100644 (file)
--- a/init.vim
+++ b/init.vim
@@ -193,12 +193,6 @@ augroup END
 
 
 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-" 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
index c0be0eaf6dda50b9efc1993aa418ce241f5f2fae..3372eee78bee53da5e633da07fdc2a344f2584cc 100644 (file)
@@ -6,3 +6,33 @@ Plug 'justmao945/vim-clang', {'for': ['c', 'cpp', 'objc']}
 "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
index 93d01f3b0238994fb09163d58fbf006e49cec6c7..4c9c4d77506d718c3624d94b0ce9b56c99feb3ee 100644 (file)
@@ -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 <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
index 0553a16fb9ef4b42f9366b325d641e995a558e71..64aa233eecf9a75ac04400fb5b2310e2f8c45a78 100644 (file)
@@ -27,6 +27,6 @@ Plug 'mattn/calendar-vim'
 
 Plug 'vim-scripts/loremipsum', {'on': 'Loremipsum'}
 
-if g:lowendbox == 0
-    source ~/.vim/plugins-noroot-nolowendbox.vim
-endif
+
+function PluginsNorootConfig()
+endfunction
index 05d93fd6c62deff49f9c40b51ad13bcc7546c8f4..fa57cc581e255a5978dce64681f875745fa5e2cc 100644 (file)
@@ -31,10 +31,71 @@ Plug 'tpope/vim-repeat'
 
 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
+
index ab7fa210c84997eda6a7f308e234c7cedcc17456..f47a045aecfecafe4de8fde09287bdbf31ac7d9f 100644 (file)
@@ -6,13 +6,46 @@ if empty(glob('~/.vim/autoload/plug.vim'))
   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()