[vim] Move plugin management to vim-plug and .vim/plugins.vim

This commit is contained in:
Eryn Wells 2023-03-20 08:40:57 -07:00
parent af9bc505bb
commit 5ad761678a
4 changed files with 44 additions and 67 deletions

View file

@ -6,7 +6,9 @@ vim.cmd [[ source ~/.vimrc.common ]]
require 'configuration'
require 'keys'
function ensureMetadataDirectoriesExist()
vim.cmd [[ source ~/.vim/plugins.vim ]]
function ensure_metadata_directories_exist()
paths = {
vim.opt.backupdir:get(),
vim.opt.directory:get(),
@ -21,4 +23,4 @@ function ensureMetadataDirectoriesExist()
end
end
ensureMetadataDirectoriesExist()
ensure_metadata_directories_exist()

View file

@ -123,25 +123,15 @@ done
print -P "%BFetching Vim modules%b"
if (( $install_vim_modules )); then
cd "$dotfiles_dir/vim/bundle"
for module in ${(k)vimbundles}; do
print -n " $module"
if [[ ! -d $module ]]; then
git clone ${vimbundles[$module]} $module >& -
if [[ $? -eq 0 ]]; then
result='done'
else
result='failed'
fi
fi
done
curl -fLo --create-dirs \
"${XDG_DATA_HOME:-$HOME/.local/share}/nvim/site/autoload/plug.vim" \
"https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim"
VIM=nvim
if ! whence -cp nvim >& -; then
VIM=vim
fi
$VIM +PluginInstall +qall
$VIM +PlugInstall +qall
else
print " Nothing to do"
fi

32
vim/plugins.vim Normal file
View file

@ -0,0 +1,32 @@
" Eryn Wells <eryn@erynwells.me>
" Set up Vim and Neovim plugins with vim-plug.
" See setup.sh in my dotfiles repo for the setup procedure.
call plug#begin()
" Filetypes
Plug 'keith/swift.vim'
Plug 'othree/html5.vim'
Plug 'pangloss/vim-javascript'
Plug 'rust-lang/rust.vim'
" Editing helpers
Plug 'tpope/vim-repeat'
Plug 'tpope/vim-speeddating'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-unimpaired'
Plug 'tpope/vim-commentary'
Plug 'PeterRincker/vim-argumentative'
" Environment niceties
Plug 'scrooloose/nerdtree'
if has('nvim')
Plug 'Mofiqul/dracula.nvim'
endif
" Snippets
Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'
call plug#end()

View file

@ -3,47 +3,6 @@
" This file holds settings common to nvim and vim.
"
" VUNDLE PLUGINS
"
set runtimepath+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
" Filetypes
Plugin 'keith/swift.vim'
Plugin 'othree/html5.vim'
Plugin 'pangloss/vim-javascript'
" Editing helpers
Plugin 'tpope/vim-repeat'
Plugin 'tpope/vim-speeddating'
Plugin 'tpope/vim-surround'
Plugin 'tpope/vim-unimpaired'
Plugin 'tpope/vim-commentary'
Plugin 'PeterRincker/vim-argumentative'
Plugin 'sjl/gundo.vim' " Undo helper
Plugin 'scrooloose/nerdtree'
"Plugin 'erynofwales/vim-fancyfolds'
Plugin 'apple-swift', {'pinned': 1}
Plugin 'rust-lang/rust.vim'
Plugin 'tidalcycles/vim-tidal'
" Colors~
"Plugin 'tomasr/molokai'
" Snippets
Plugin 'MarcWeber/vim-addon-mw-utils'
Plugin 'tomtom/tlib_vim'
Plugin 'garbas/vim-snipmate'
Plugin 'honza/vim-snippets'
call vundle#end()
"
" CONFIG OPTIONS
"
@ -169,8 +128,10 @@ let g:snips_author = 'Eryn Wells <eryn@erynwells.me>'
let g:snipMate.scope_aliases = {}
let g:snipMate.scope_aliases["java"] = "android"
" set the Gundo preview window on the bottom
let g:gundo_preview_bottom = 1
if has('mac')
let g:rust_clip_command = 'pbcopy'
endif
let g:rustfmt_autosave = 1
"
" PATHS
@ -178,14 +139,6 @@ let g:gundo_preview_bottom = 1
set path=.,,/usr/local/include,/usr/include
if has('mac')
let g:xcode_path = system('xcode-select -p')
let s:clang_library_path = g:xcode_path . 'Toolchains/XcodeDefault.xctoolchain/usr/lib'
if isdirectory(s:clang_library_path)
let g:clang_library_path = s:clang_library_path
endif
endif
"
" Mappings
"