plugins: Merge init files into plugin files
[vimconf.git] / plugins.vim
index 79f4cd3b773ac2f950c83d31b476523c17044eba..fa57cc581e255a5978dce64681f875745fa5e2cc 100644 (file)
 function! Cond(cond, ...)
-  let opts = get(a:000, 0, {})
-  return a:cond ? opts : extend(opts, { 'on': [], 'for': [] })
+    let opts = get(a:000, 0, {})
+    return a:cond ? opts : extend(opts, { 'on': [], 'for': [] })
 endfunction
 
 Plug 'mhinz/vim-startify'
+Plug 'dstein64/vim-startuptime'
 
 Plug 'vim-airline/vim-airline'
 Plug 'gruvbox-community/gruvbox'
 
 Plug 'benknoble/vim-auto-origami'
-" Prevent slow foling update, e.g., for vimtex
-Plug 'Konfekt/FastFold'
 
 Plug 'scrooloose/nerdcommenter'
-
-Plug 'joom/latex-unicoder.vim', {'on': '<Plug>Unicoder'}
-
 Plug 'scrooloose/nerdtree', {'on': 'NERDTreeToggle'}
-Plug 'ryanoasis/vim-devicons', Cond(g:enable_plugin_devicons)
 
-Plug 'Konfekt/vim-DetectSpellLang', {'do': 'spell'}
 Plug 'roryokane/detectindent'
 
-Plug 'derekwyatt/vim-fswitch', {'for': ['c', 'cpp', 'objc']}
+" This plugin cannot be conditionally loaded, see github issue #18
+Plug 'derekwyatt/vim-fswitch' ", {'for': ['c', 'cpp', 'objc']}
 
 Plug 'godlygeek/tabular'
 Plug 'junegunn/vim-easy-align'
 
 Plug 'thinca/vim-fontzoom'
 
-Plug 'vim-scripts/loremipsum', {'on': 'Loremipsum'}
-
 Plug 'lambdalisue/vim-manpager', {'on': 'MANPAGER'}
 
-Plug 'https://gitlab.com/dbeniamine/vim-mail'
-
-Plug 'dstein64/vim-startuptime'
-
 " Make . more useful after a plugin map
 Plug 'tpope/vim-repeat'
 
 Plug 'flwyd/vim-conjoin'
 
-if $USER != "root"
-  Plug 'majutsushi/tagbar', {'on': 'TagbarToggle'}
-
-  Plug 'ludovicchabant/vim-gutentags', {'for': ['c', 'cpp', 'objc']}
-  "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'}
-  Plug 'habamax/vim-asciidoctor', {'for': 'asciidoc'}
+function PluginsConfig()
+    let g:localvimrc_persistent = 1
 
-  Plug 'PProvost/vim-markdown-jekyll', {'for': 'markdown'}
-  Plug 'tpope/vim-liquid', {'for': ['liquid', 'html', 'xml', 'markdown']}
+    let g:fastfold_minlines = 0
 
-  Plug 'tpope/vim-ragtag'
+    au FileType markdown call RagtagInit()
 
-  Plug 'Shougo/neosnippet.vim'
-  Plug 'Shougo/neosnippet-snippets'
+    let g:detectspelllang_langs = {}
+    let g:detectspelllang_langs.aspell =[ 'en_US', 'de_AT']
+    au FileType mail let g:VimMailSpellLangs=['de', 'en']
 
-  Plug 'tpope/vim-speeddating'
-  Plug 'mattn/calendar-vim'
+    let g:org_todo_keywords = [['TODO(t)', 'WAITING(w)', '|', 'DONE(d)'],
+                \ ['|', 'OBSOLETE(o)', 'WONT(n)'],
+                \ ['CANCELED(c)']]
 
-  " Costs a second startup time
-  Plug 'dbeniamine/cheat.sh-vim', {'on': 'Cheat'}
+    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
 
-  if g:lowendbox == 0
-    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'}
+    let g:VimMailContactsProvider=['khard']
+    let g:VimMailContactsCommands={
+                \'khard':
+                \{ 'query' : "khard email --parsable --search-in-source-files",
+                \'sync': "/bin/true"}
+                \}
 
-    Plug 'neomake/neomake'
+    let g:vimtex_fold_enabled = 1
+    let g:vimtex_fold_levelmarker = '➜'
 
-    Plug 'lervag/vimtex', {'for': 'tex'}
+    " termdebug split windows
+    let g:termdebug_wide = 1
+    let termdebugger = $HOME . '/.vim/gdb.sh'
 
-    Plug 'mhinz/vim-signify'
-    Plug 'tpope/vim-fugitive'
-    Plug 'gko/vim-coloresque'
+    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'] },
+                \ ]
 
-    Plug 'vimwiki/vimwiki'
-    Plug 'jceb/vim-orgmode', {'for': ['org']}
-
-    Plug 'cakebaker/scss-syntax.vim', {'for': 'scss'}
-    Plug 'hail2u/vim-css3-syntax', {'for': ['scss', 'css']}
-
-    Plug 'sjl/splice.vim', {'on': 'SpliceInit'}
-
-    if has('nvim-0.5')
-      Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
+    if has('nvim')
+        let verstr = matchstr(execute('version'), 'NVIM v\zs[^\n]*')
+        let g:startify_custom_header = [
+                    \ '',
+                    \ '        ╻ ╻   ╻   ┏┳┓',
+                    \ '   NEO  ┃┏┛   ┃   ┃┃┃',
+                    \ '        ┗┛    ╹   ╹ ╹  ' . verstr,
+                    \ '',
+                    \ ]
     else
-      Plug 'sheerun/vim-polyglot'
+        let verstr = matchstr(execute('version'), 'IMproved \zs[^\n ]*')
+        let g:startify_custom_header = [
+                    \ '',
+                    \ '   ╻ ╻   ╻   ┏┳┓',
+                    \ '   ┃┏┛   ┃   ┃┃┃',
+                    \ '   ┗┛    ╹   ╹ ╹  ' . verstr,
+                    \ '',
+                    \ ]
     endif
-  endif
-endif
+endfunction
 
-if filereadable($HOME . '/.vim/plugins-local.vim')
-  source ~/.vim/plugins-local.vim
-endif