add vim-devicons
authorAJ ONeal <aj@therootcompany.com>
Wed, 24 Mar 2021 17:43:37 +0000 (17:43 +0000)
committerAJ ONeal <aj@therootcompany.com>
Wed, 24 Mar 2021 17:51:30 +0000 (17:51 +0000)
vim-devicons/README.md [new file with mode: 0644]
vim-devicons/devicons.vim [new file with mode: 0644]
vim-devicons/install.ps1 [new file with mode: 0644]
vim-devicons/install.sh [new file with mode: 0644]

diff --git a/vim-devicons/README.md b/vim-devicons/README.md
new file mode 100644 (file)
index 0000000..fd64379
--- /dev/null
@@ -0,0 +1,20 @@
+---
+title: vim-devicons
+homepage: https://github.com/ryanoasis/devicons
+tagline: |
+  VimDevIcons: Adds Icons to Your Plugins.
+---
+
+**Important**: You must install [NerdFont](https://webinstall.dev/nerdfont) (and
+configure your Terminal to use it) first.
+
+To update (replacing the current version) run `webi vim-devicons`.
+
+## Cheat Sheet
+
+![](https://raw.githubusercontent.com/wiki/ryanoasis/vim-devicons/screenshots/v0.10.x/overall-screenshot.png)
+
+> Adds icons to NERDTree, vim-airline, CtrlP, unite, Denite, lightline,
+> vim-startify and many more
+
+vim-devicons is fairly plug-n-play. Install it, and it works.
diff --git a/vim-devicons/devicons.vim b/vim-devicons/devicons.vim
new file mode 100644 (file)
index 0000000..1dfc08c
--- /dev/null
@@ -0,0 +1,2 @@
+" The defaults are already rather reasonable.
+" See https://github.com/ryanoasis/vim-devicons/wiki/Extra-Configuration
diff --git a/vim-devicons/install.ps1 b/vim-devicons/install.ps1
new file mode 100644 (file)
index 0000000..6a8f082
--- /dev/null
@@ -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
+}
+Remove-Item -Path "$Env:USERPROFILE\.vim\pack\plugins\start\devicons" -Recurse -ErrorAction Ignore
+& git clone --depth=1 https://github.com/ryanoasis/vim-devicons.git "$Env:USERPROFILE\.vim\pack\plugins\start\devicons.vim"
diff --git a/vim-devicons/install.sh b/vim-devicons/install.sh
new file mode 100644 (file)
index 0000000..68d96b7
--- /dev/null
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+function __init_vim_devicons() {
+    set -e
+    set -u
+
+    mkdir -p "$HOME/.vim/pack/plugins/start"
+    rm -rf "$HOME/.vim/pack/plugins/start/devicons.vim"
+    git clone --depth=1 https://github.com/ryanoasis/vim-devicons.git "$HOME/.vim/pack/plugins/start/devicons.vim"
+
+    if [ ! -f "$HOME/.vimrc" ]; then
+        touch "$HOME/.vimrc"
+    fi
+
+    mkdir -p ~/.vim/plugins
+    if ! [ -f "$HOME/.vim/plugins/devicons.vim" ]; then
+        WEBI_HOST=${WEBI_HOST:-"https://webinstall.dev"}
+        curl -fsSL -o ~/.vim/plugins/devicons.vim "$WEBI_HOST/packages/vim-devicons/devicons.vim"
+    fi
+
+    if ! grep 'source.*plugins.devicons.vim' -r ~/.vimrc >/dev/null 2>/dev/null; then
+        set +e
+        mkdir -p ~/.vim/plugins
+        printf '\n" devicons: reasonable defaults from webinstall.dev/vim-devicons\n' >> ~/.vimrc
+        printf 'source ~/.vim/plugins/devicons.vim\n' >> ~/.vimrc
+        set -e
+        echo ""
+        echo "add ~/.vim/plugins/devicons.vim"
+        echo "updated ~/.vimrc with 'source ~/.vim/plugins/devicons.vim'"
+    fi
+
+    echo ""
+    echo "vim-devicons enabled (NOTE: you must also have https://webinstall.dev/nerdfont)"
+
+}
+
+__init_vim_devicons