[vim] Move plugin management to vim-plug and .vim/plugins.vim
This commit is contained in:
parent
af9bc505bb
commit
5ad761678a
4 changed files with 44 additions and 67 deletions
|
@ -6,7 +6,9 @@ vim.cmd [[ source ~/.vimrc.common ]]
|
||||||
require 'configuration'
|
require 'configuration'
|
||||||
require 'keys'
|
require 'keys'
|
||||||
|
|
||||||
function ensureMetadataDirectoriesExist()
|
vim.cmd [[ source ~/.vim/plugins.vim ]]
|
||||||
|
|
||||||
|
function ensure_metadata_directories_exist()
|
||||||
paths = {
|
paths = {
|
||||||
vim.opt.backupdir:get(),
|
vim.opt.backupdir:get(),
|
||||||
vim.opt.directory:get(),
|
vim.opt.directory:get(),
|
||||||
|
@ -21,4 +23,4 @@ function ensureMetadataDirectoriesExist()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
ensureMetadataDirectoriesExist()
|
ensure_metadata_directories_exist()
|
||||||
|
|
18
setup.sh
18
setup.sh
|
@ -123,25 +123,15 @@ done
|
||||||
|
|
||||||
print -P "%BFetching Vim modules%b"
|
print -P "%BFetching Vim modules%b"
|
||||||
if (( $install_vim_modules )); then
|
if (( $install_vim_modules )); then
|
||||||
cd "$dotfiles_dir/vim/bundle"
|
curl -fLo --create-dirs \
|
||||||
for module in ${(k)vimbundles}; do
|
"${XDG_DATA_HOME:-$HOME/.local/share}/nvim/site/autoload/plug.vim" \
|
||||||
print -n " $module"
|
"https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim"
|
||||||
|
|
||||||
if [[ ! -d $module ]]; then
|
|
||||||
git clone ${vimbundles[$module]} $module >& -
|
|
||||||
if [[ $? -eq 0 ]]; then
|
|
||||||
result='done'
|
|
||||||
else
|
|
||||||
result='failed'
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
VIM=nvim
|
VIM=nvim
|
||||||
if ! whence -cp nvim >& -; then
|
if ! whence -cp nvim >& -; then
|
||||||
VIM=vim
|
VIM=vim
|
||||||
fi
|
fi
|
||||||
$VIM +PluginInstall +qall
|
$VIM +PlugInstall +qall
|
||||||
else
|
else
|
||||||
print " Nothing to do"
|
print " Nothing to do"
|
||||||
fi
|
fi
|
||||||
|
|
32
vim/plugins.vim
Normal file
32
vim/plugins.vim
Normal 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()
|
55
vimrc.common
55
vimrc.common
|
@ -3,47 +3,6 @@
|
||||||
|
|
||||||
" This file holds settings common to nvim and vim.
|
" 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
|
" 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 = {}
|
||||||
let g:snipMate.scope_aliases["java"] = "android"
|
let g:snipMate.scope_aliases["java"] = "android"
|
||||||
|
|
||||||
" set the Gundo preview window on the bottom
|
if has('mac')
|
||||||
let g:gundo_preview_bottom = 1
|
let g:rust_clip_command = 'pbcopy'
|
||||||
|
endif
|
||||||
|
let g:rustfmt_autosave = 1
|
||||||
|
|
||||||
"
|
"
|
||||||
" PATHS
|
" PATHS
|
||||||
|
@ -178,14 +139,6 @@ let g:gundo_preview_bottom = 1
|
||||||
|
|
||||||
set path=.,,/usr/local/include,/usr/include
|
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
|
" Mappings
|
||||||
"
|
"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue