mirror of
https://github.com/webinstall/webi-installers.git
synced 2026-02-14 17:49:53 +00:00
add vim-airline-themes installer
This commit is contained in:
20
vim-airline-themes/README.md
Normal file
20
vim-airline-themes/README.md
Normal 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.
|
||||
1
vim-airline-themes/airline.vim
Normal file
1
vim-airline-themes/airline.vim
Normal file
@@ -0,0 +1 @@
|
||||
let g:airline_theme='simple'
|
||||
7
vim-airline-themes/install.ps1
Normal file
7
vim-airline-themes/install.ps1
Normal 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"
|
||||
42
vim-airline-themes/install.sh
Normal file
42
vim-airline-themes/install.sh
Normal 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
|
||||
Reference in New Issue
Block a user