From 1ccb61013d535947b52337ff72b8444f25499aa9 Mon Sep 17 00:00:00 2001 From: bretello Date: Thu, 14 Sep 2023 23:54:50 +0200 Subject: [PATCH] vim: make plugs lazier --- vim/plugs.vim | 38 +++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/vim/plugs.vim b/vim/plugs.vim index c641e83..e5df5b6 100644 --- a/vim/plugs.vim +++ b/vim/plugs.vim @@ -40,14 +40,18 @@ Plug 'https://github.com/maxbrunsfeld/vim-yankstack' " Mark indentation level Plug 'https://github.com/nathanaelkane/vim-indent-guides' -" Meson + Ninja -Plug 'https://github.com/igankevich/mesonic' + +if executable('meson') + Plug 'https://github.com/igankevich/mesonic' +endif " fzf Plug 'junegunn/fzf' Plug 'junegunn/fzf.vim' " Open tags with fzf's :Tags -Plug 'https://github.com/ludovicchabant/vim-gutentags.git' +if executable('ctags') + Plug 'https://github.com/ludovicchabant/vim-gutentags.git' +endif " snippets if has('python3') @@ -65,29 +69,45 @@ Plug 'https://github.com/mgedmin/coverage-highlight.vim' "Languages Plug 'https://github.com/bfrg/vim-cpp-modern', {'for': 'cpp'} -Plug 'https://github.com/rust-lang/rust.vim', {'for': 'rust'} +Plug 'epheien/termdbg', {'for': ['c', 'cpp']} + +if executable('cargo') + Plug 'https://github.com/rust-lang/rust.vim', {'for': 'rust'} +endif Plug 'https://github.com/vim-scripts/nginx.vim', {'for': 'nginx'} Plug 'https://github.com/plasticboy/vim-markdown', {'for': 'markdown'} Plug 'https://github.com/cespare/vim-toml', {'for': 'toml'} Plug 'https://github.com/vim-scripts/iptables', {'for': 'iptables'} -Plug 'https://github.com/leafoftree/vim-vue-plugin', {'for': 'vue'} -Plug 'https://github.com/hashivim/vim-terraform', {'for': 'terraform'} -Plug 'https://github.com/fatih/vim-go', {'for': 'go'} +if executable('vite') + " TODO: check if plugin is still up-to-date + Plug 'https://github.com/leafoftree/vim-vue-plugin', {'for': 'vue'} +endif +if executable('terraform') + Plug 'https://github.com/hashivim/vim-terraform', {'for': 'terraform'} +endif +if executable('go') + Plug 'https://github.com/fatih/vim-go', {'for': 'go'} +endif if executable('adb') && executable('gradle') Plug 'https://github.com/udalov/kotlin-vim', {'for': 'kotlin'} Plug 'https://github.com/hsanson/vim-android', {'for': 'java'} endif -" Plug 'epheien/termdbg' +if executable('qml') + Plug 'https://github.com/peterhoeg/vim-qml', {'for': 'qml'} +endif -Plug 'https://github.com/alfredodeza/pytest.vim', {'for': 'python'} +if executable('pytest') + Plug 'https://github.com/alfredodeza/pytest.vim', {'for': 'python'} +endif " No RGB, no party let vim_razer = expand('~/projects_razer/vim-razer') if isdirectory(vim_razer) Plug vim_razer endif + call plug#end() " Install plugins if missing