add vim-airline-themes installer

This commit is contained in:
Ryan Burnette
2023-05-28 21:41:58 -04:00
committed by AJ ONeal
parent b406af83a6
commit 54d41336c4
4 changed files with 70 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
---
title: vim-airline-themes
homepage: https://github.com/vim-airline/vim-airline-themes
tagline: |
The official theme repository for vim-airline
---
## Cheat Sheet
> The official themes for vim-airline.
This installer adds the theme selection to `~/.vim/plugins/airline.vim` which is
created by the vim-airline installer.
```
let g:airline_theme='simple'
```
See the [docs](https://github.com/vim-airline/vim-airline-themes) for a list of
available themes.

View File

@@ -0,0 +1 @@
let g:airline_theme='simple'

View File

@@ -0,0 +1,7 @@
#!/usr/bin/env pwsh
IF (!(Test-Path -Path "$Env:USERPROFILE\.vim\pack\plugins\start")) {
New-Item -Path "$Env:USERPROFILE\.vim\pack\plugins\start" -ItemType Directory -Force | out-null
}
Remove-Item -Path "$Env:USERPROFILE\.vim\pack\plugins\start\vim-airline-themes" -Recurse -ErrorAction Ignore
& git clone --depth=1 https://github.com/vim-airline/vim-airline-themes.git "$Env:USERPROFILE\.vim\pack\plugins\start\vim-airline-themes"

View File

@@ -0,0 +1,42 @@
#!/bin/sh
__init_vim_airline_themes() {
set -e
set -u
mkdir -p "$HOME/.vim/pack/plugins/start"
rm -rf "$HOME/.vim/pack/plugins/start/vim-airline-themes"
git clone --depth=1 https://github.com/vim-airline/vim-airline-themes.git "$HOME/.vim/pack/plugins/start/vim-airline-themes"
if [ ! -f "$HOME/.vimrc" ]; then
touch "$HOME/.vimrc"
fi
mkdir -p ~/.vim/plugins
if [ -f "$HOME/.vim/plugins/airline.vim" ]; then
WEBI_HOST=${WEBI_HOST:-"https://webinstall.dev"}
if ! grep -qF "let g:airline_theme=" $HOME/.vim/plugins/airline.vim; then
echo ""
echo "set theme 'simple' as default, update in $HOME/.vim/plugins/airline.vim"
curl -s "$WEBI_HOST/packages/vim-airline-themes/airline.vim" >> $HOME/.vim/plugins/airline.vim
fi
else
curl -fsSL -o ~/.vim/plugins/airline.vim "$WEBI_HOST/packages/vim-airline-themes/airline.vim"
fi
if ! grep 'source.*plugins.airline.vim' -r ~/.vimrc > /dev/null 2> /dev/null; then
set +e
mkdir -p ~/.vim/plugins
printf '\n" vim-airline-themes: reasonable defaults from webinstall.dev/vim-airline-themes\n' >> ~/.vimrc
printf 'source ~/.vim/plugins/airline.vim\n' >> ~/.vimrc
set -e
echo ""
echo "add ~/.vim/plugins/airline.vim"
echo "updated ~/.vimrc with 'source ~/.vim/plugins/airline.vim'"
fi
echo ""
echo "vim-airline-themes enabled with reasonable defaults"
}
__init_vim_airline_themes