mirror of
https://github.com/donovanglover/nix-config.git
synced 2024-12-17 04:10:56 +01:00
vim: Strategically install plugins
Instead of failing silently when the wal colorscheme is not found, we can take this as a cue to install the necessary vim plugins instead.
This commit is contained in:
parent
b0b27be0ab
commit
151e706a36
10
vim/.vimrc
10
vim/.vimrc
@ -11,7 +11,6 @@ let plugusr = glob('~/.vim/autoload/plug.vim')
|
|||||||
if empty(plugsys) && empty(plugusr)
|
if empty(plugsys) && empty(plugusr)
|
||||||
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
|
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
|
||||||
\ https://raw.githubusercontent.com/junegunn/vim-plug/0.10.0/plug.vim
|
\ https://raw.githubusercontent.com/junegunn/vim-plug/0.10.0/plug.vim
|
||||||
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
call plug#begin('~/.vim/plugged')
|
call plug#begin('~/.vim/plugged')
|
||||||
@ -101,8 +100,13 @@ set mouse=a " Enable mouse support in (a)ll modes
|
|||||||
" ========= colors =========
|
" ========= colors =========
|
||||||
" ==========================
|
" ==========================
|
||||||
|
|
||||||
" Set the color scheme to wal, or fail silently if it's not installed
|
" Set the color scheme to wal, or install plugins as needed.
|
||||||
silent! colorscheme wal
|
try
|
||||||
|
colorscheme wal
|
||||||
|
catch /^Vim\%((\a\+)\)\=:E185/
|
||||||
|
echo "wal was not found. Installing plugins...\n" | PlugInstall --sync
|
||||||
|
echo "Plugins installed! You can now use vim.\n" | qa
|
||||||
|
endtry
|
||||||
|
|
||||||
" Don't show the separator for vertical splits
|
" Don't show the separator for vertical splits
|
||||||
highlight vertsplit ctermfg=0 ctermbg=none
|
highlight vertsplit ctermfg=0 ctermbg=none
|
||||||
|
Loading…
Reference in New Issue
Block a user