From be04b8aaf064a708d3d182d2f518de22fb564540 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Sun, 4 Jul 2021 11:01:15 -0500 Subject: [PATCH] Colors overhaul --- common/bin/dns-cleaner | 7 + common/bin/dns-deleter | 11 + common/colors/generator/.gitignore | 1 - common/colors/generator/gen.bash | 47 --- common/colors/generator/gen.moon | 20 -- common/colors/generator/schemes/bright.yml | 18 -- common/colors/generator/schemes/donokai.moon | 22 -- common/colors/generator/schemes/donokai.yml | 18 -- .../colors/generator/schemes/donokaiblack.yml | 18 -- common/colors/generator/schemes/holodized.yml | 37 --- common/colors/generator/templates/shell | 250 --------------- common/colors/generator/templates/shell.moon | 255 --------------- common/colors/set-theme.bash | 13 - common/colors/shell | 132 ++++---- common/colors/vconsole | 96 +++--- common/colors/vim | 302 ------------------ common/colors/xresources | 52 --- common/neovim/.gitignore | 1 + common/neovim/init.lua | 54 ++-- common/neovim/lua/keymap.lua | 11 +- common/neovim/lua/lsp.lua | 4 +- common/neovim/lua/options.lua | 50 +-- common/neovim/lua/plugins.lua | 6 +- 23 files changed, 179 insertions(+), 1246 deletions(-) create mode 100755 common/bin/dns-cleaner create mode 100755 common/bin/dns-deleter delete mode 100644 common/colors/generator/.gitignore delete mode 100755 common/colors/generator/gen.bash delete mode 100755 common/colors/generator/gen.moon delete mode 100644 common/colors/generator/schemes/bright.yml delete mode 100644 common/colors/generator/schemes/donokai.moon delete mode 100644 common/colors/generator/schemes/donokai.yml delete mode 100644 common/colors/generator/schemes/donokaiblack.yml delete mode 100644 common/colors/generator/schemes/holodized.yml delete mode 100755 common/colors/generator/templates/shell delete mode 100644 common/colors/generator/templates/shell.moon delete mode 100755 common/colors/set-theme.bash delete mode 100644 common/colors/vim delete mode 100644 common/colors/xresources diff --git a/common/bin/dns-cleaner b/common/bin/dns-cleaner new file mode 100755 index 0000000..442b141 --- /dev/null +++ b/common/bin/dns-cleaner @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +set -x -e +API="https://api.netlify.com/api/v1" +TOKEN="$(pass netlify | grep -i token | tr -d ' ' | cut -d ':' -f 2)" +URL="$API/dns_zones/lyte_dev/dns_records?access_token=$TOKEN" +curl -sL "$URL" > /tmp/zone.json diff --git a/common/bin/dns-deleter b/common/bin/dns-deleter new file mode 100755 index 0000000..953fef1 --- /dev/null +++ b/common/bin/dns-deleter @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +API="https://api.netlify.com/api/v1" +TOKEN="$(pass netlify | grep -i token | tr -d ' ' | cut -d ':' -f 2)" +while read -r l; do + set -x -e + ID="$(echo $l | awk '{print $2}')" + URL="$API/dns_zones/lyte_dev/dns_records/$ID?access_token=$TOKEN" + curl -X DELETE -sL "$URL" & +done +wait diff --git a/common/colors/generator/.gitignore b/common/colors/generator/.gitignore deleted file mode 100644 index 22d0d82..0000000 --- a/common/colors/generator/.gitignore +++ /dev/null @@ -1 +0,0 @@ -vendor diff --git a/common/colors/generator/gen.bash b/common/colors/generator/gen.bash deleted file mode 100755 index df3acf4..0000000 --- a/common/colors/generator/gen.bash +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env bash - -SCHEME="donokai" -TYPE="dark" - -# v=$(ruby --version) - -if [[ $? -eq 0 ]]; then - if [[ -n $1 ]]; then SCHEME=$1; fi - if [[ -n $2 ]]; then TYPE=$2; fi - - DIR=$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd) - - mkdir -p "$DIR/vendor" - - B16_DIR="$DIR/vendor/base16-builder" - COLORS_PATH="$B16_DIR/output" - - if [ -d "$B16_DIR" ]; then - echo "Skipping repo pull down..." - rm -rf "$COLORS_PATH" - mkdir -p "$COLORS_PATH" - else - git clone https://github.com/lytedev/base16-builder.git "$DIR/vendor/base16-builder" - fi - - "$DIR/vendor/base16-builder/base16" -t vim -s "$DIR/schemes/$SCHEME.yml" - "$DIR/vendor/base16-builder/base16" -t vconsole -s "$DIR/schemes/$SCHEME.yml" - "$DIR/vendor/base16-builder/base16" -t xresources -s "$DIR/schemes/$SCHEME.yml" - "$DIR/vendor/base16-builder/base16" -t shell -s "$DIR/schemes/$SCHEME.yml" - - # replace existing color files - rm -f "$DIR/../shell" - rm -f "$DIR/../vconsole" - rm -f "$DIR/../vim" - rm -f "$DIR/../xresources" - cp "$COLORS_PATH/xresources/base16-$SCHEME.$TYPE.xresources" "$DIR/../xresources" - cp "$COLORS_PATH/vconsole/base16-$SCHEME.$TYPE.sh" "$DIR/../vconsole" - cp "$COLORS_PATH/vim/base16-$SCHEME.vim" "$DIR/../vim" - cp "$COLORS_PATH/shell/base16-$SCHEME.$TYPE.sh" "$DIR/../shell" - chmod +x "$DIR/../shell" - chmod +x "$DIR/../vconsole" - - echo "Colors have been regenerated. You will need to re-link them." -else - echo "Ruby isn't installed." -fi diff --git a/common/colors/generator/gen.moon b/common/colors/generator/gen.moon deleted file mode 100755 index 0a3a826..0000000 --- a/common/colors/generator/gen.moon +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env moon - -scheme_file = "donokai" -template_file = [ - "shell" -] - -scheme = require(scheme_file)! - -scheme.meta = scheme.meta || {} -scheme.meta.author = scheme.meta.author || "Unknown Author" -scheme.meta.name = scheme.meta.name || "Unnamed Color Scheme" - -for f in template_files - template_data = require(t)! - - colors = scheme.colors - if "function" == type template_data.color_map - colors = {template_data.color_map(k, v) for k, v in pairs(colors)} - diff --git a/common/colors/generator/schemes/bright.yml b/common/colors/generator/schemes/bright.yml deleted file mode 100644 index bfe73eb..0000000 --- a/common/colors/generator/schemes/bright.yml +++ /dev/null @@ -1,18 +0,0 @@ -scheme: "Bright" -author: "Chris Kempson (http://chriskempson.com)" -base00: "111111" -base01: "303030" -base02: "505050" -base03: "b0b0b0" -base04: "d0d0d0" -base05: "e0e0e0" -base06: "f5f5f5" -base07: "ffffff" -base08: "fb0120" -base09: "fc6d24" -base0A: "fda331" -base0B: "a1c659" -base0C: "76c7b7" -base0D: "6fb3d2" -base0E: "d381c3" -base0F: "be643c" diff --git a/common/colors/generator/schemes/donokai.moon b/common/colors/generator/schemes/donokai.moon deleted file mode 100644 index 0891293..0000000 --- a/common/colors/generator/schemes/donokai.moon +++ /dev/null @@ -1,22 +0,0 @@ -=> - meta: - name: "Donokai" - author: "Daniel Flanagan (https://lyte.dev)" - - colors: - base00: "111111" -- background, dark grey - base01: "383830" -- lighter grey - base02: "49483e" -- lighter grey - base03: "75715e" -- pale-ish yellow - base04: "a59f85" -- lighter peuce - base05: "f8f8f2" -- foreground white - base06: "f5f4f1" -- foreground 2 white - base07: "f9f8f5" -- foreground 3 white - base08: "f92672" -- magenta - base09: "fd971f" -- orange - base0A: "f4bf75" -- yellow - base0B: "a6e22e" -- green - base0C: "a1efe4" -- cyan - base0D: "66d9ef" -- blue - base0E: "ae81ff" -- purple - base0F: "cc6633" -- pale orange diff --git a/common/colors/generator/schemes/donokai.yml b/common/colors/generator/schemes/donokai.yml deleted file mode 100644 index b88099d..0000000 --- a/common/colors/generator/schemes/donokai.yml +++ /dev/null @@ -1,18 +0,0 @@ -scheme: "Donokai" -author: "Daniel Flanagan(https://lytedev.io)" -base00: "111111" # background, dark grey -base01: "383830" # lighter grey -base02: "49483e" # lighter grey -base03: "75715e" # pale-ish yellow -base04: "a59f85" # lighter peuce -base05: "f8f8f2" # foreground white -base06: "f5f4f1" # foreground 2 white -base07: "f9f8f5" # foreground 3 white -base08: "f92672" # magenta -base09: "fd971f" # orange -base0A: "f4bf75" # yellow -base0B: "a6e22e" # green -base0C: "a1efe4" # cyan -base0D: "66d9ef" # blue -base0E: "ae81ff" # purple -base0F: "cc6633" # pale orange diff --git a/common/colors/generator/schemes/donokaiblack.yml b/common/colors/generator/schemes/donokaiblack.yml deleted file mode 100644 index 8a16901..0000000 --- a/common/colors/generator/schemes/donokaiblack.yml +++ /dev/null @@ -1,18 +0,0 @@ -scheme: "Donokai-BLACK" -author: "Daniel Flanagan(https://lytedev.io)" -base00: "000000" # background, dark grey -base01: "383830" # lighter grey -base02: "49483e" # lighter grey -base03: "75715e" # pale-ish yellow -base04: "a59f85" # lighter peuce -base05: "f8f8f2" # foreground white -base06: "f5f4f1" # foreground 2 white -base07: "f9f8f5" # foreground 3 white -base08: "f92672" # magenta -base09: "fd971f" # orange -base0A: "f4bf75" # yellow -base0B: "a6e22e" # green -base0C: "a1efe4" # cyan -base0D: "66d9ef" # blue -base0E: "ae81ff" # purple -base0F: "cc6633" # pale orange diff --git a/common/colors/generator/schemes/holodized.yml b/common/colors/generator/schemes/holodized.yml deleted file mode 100644 index dc8fc1e..0000000 --- a/common/colors/generator/schemes/holodized.yml +++ /dev/null @@ -1,37 +0,0 @@ -scheme: "Holodized" -author: "Daniel Flanagan(https://lytedev.io)" -base00: "eeeeee" # background, light cream -base01: "ddd6c3" # darker cream -base02: "ada693" # darker cream -base03: "8d8673" # pale-ish yellow -base04: "554f45" # darker peuce -base05: "111111" # foreground dark grey -base06: "555555" # foreground 2 dark grey -base07: "888888" # foreground 3 dark grey -base08: "990833" # magenta -base09: "8d370f" # orange -base0A: "947010" # yellow -base0B: "06623e" # green -base0C: "006677" # cyan -base0D: "004488" # blue -base0E: "4e117f" # purple -base0F: "883311" # pale orange - -# scheme: "Holodized" -# author: "Daniel Flanagan @lytedev (modified Solarized Light)" -# base00: "fdf6e3" -# base01: "eee8d5" -# base02: "93a1a1" -# base03: "839496" -# base04: "657b83" -# base05: "111111" -# base06: "073642" -# base07: "002b36" -# base08: "8c220f" -# base09: "8b2b06" -# base0A: "b58900" -# base0B: "859900" -# base0C: "2aa198" -# base0D: "268bd2" -# base0E: "6c71c4" -# base0F: "d33682" diff --git a/common/colors/generator/templates/shell b/common/colors/generator/templates/shell deleted file mode 100755 index b9d353c..0000000 --- a/common/colors/generator/templates/shell +++ /dev/null @@ -1,250 +0,0 @@ -#!/bin/sh -# Base16 <%= @.scheme %> - Shell color setup script -# <%= @author %> - -if [ "${TERM%%-*}" = 'linux' ]; then - # This script doesn't support linux console (use 'vconsole' template instead) - return 2>/dev/null || exit 0 -fi - -color00="<%= split_by_slash(@base["00"]["hex"]) %>" # Base 00 - Black -color01="<%= split_by_slash(@base["08"]["hex"]) %>" # Base 08 - Red -color02="<%= split_by_slash(@base["0B"]["hex"]) %>" # Base 0B - Green -color03="<%= split_by_slash(@base["0A"]["hex"]) %>" # Base 0A - Yellow -color04="<%= split_by_slash(@base["0D"]["hex"]) %>" # Base 0D - Blue -color05="<%= split_by_slash(@base["0E"]["hex"]) %>" # Base 0E - Magenta -color06="<%= split_by_slash(@base["0C"]["hex"]) %>" # Base 0C - Cyan -color07="<%= split_by_slash(@base["05"]["hex"]) %>" # Base 05 - White -color08="<%= split_by_slash(@base["03"]["hex"]) %>" # Base 03 - Bright Black -color09=$color01 # Base 08 - Bright Red -color10=$color02 # Base 0B - Bright Green -color11=$color03 # Base 0A - Bright Yellow -color12=$color04 # Base 0D - Bright Blue -color13=$color05 # Base 0E - Bright Magenta -color14=$color06 # Base 0C - Bright Cyan -color15="<%= split_by_slash(@base["07"]["hex"]) %>" # Base 07 - Bright White -color16="<%= split_by_slash(@base["09"]["hex"]) %>" # Base 09 -color17="<%= split_by_slash(@base["0F"]["hex"]) %>" # Base 0F -color18="<%= split_by_slash(@base["01"]["hex"]) %>" # Base 01 -color19="<%= split_by_slash(@base["02"]["hex"]) %>" # Base 02 -color20="<%= split_by_slash(@base["04"]["hex"]) %>" # Base 04 -color21="<%= split_by_slash(@base["06"]["hex"]) %>" # Base 06 -color_foreground="<%= split_by_slash(@base["05"]["hex"]) %>" # Base 05 -color_background="<%= split_by_slash(@base["00"]["hex"]) %>" # Base 00 -color_cursor="<%= split_by_slash(@base["05"]["hex"]) %>" # Base 05 - -if [ -n "$TMUX" ]; then - # tell tmux to pass the escape sequences through - # (Source: http://permalink.gmane.org/gmane.comp.terminal-emulators.tmux.user/1324) - printf_template="\033Ptmux;\033\033]4;%d;rgb:%s\007\033\\" - printf_template_var="\033Ptmux;\033\033]%d;rgb:%s\007\033\\" - printf_template_custom="\033Ptmux;\033\033]%s%s\007\033\\" -elif [ "${TERM%%-*}" = "screen" ]; then - # GNU screen (screen, screen-256color, screen-256color-bce) - printf_template="\033P\033]4;%d;rgb:%s\007\033\\" - printf_template_var="\033P\033]%d;rgb:%s\007\033\\" - printf_template_custom="\033P\033]%s%s\007\033\\" -elif [[ $- != *i* ]]; then - # non-interactive - alias printf=/bin/false -else - printf_template="\033]4;%d;rgb:%s\033\\" - printf_template_var="\033]%d;rgb:%s\033\\" - printf_template_custom="\033]%s%s\033\\" -fi - -# 16 color space -printf $printf_template 0 $color00 -printf $printf_template 1 $color01 -printf $printf_template 2 $color02 -printf $printf_template 3 $color03 -printf $printf_template 4 $color04 -printf $printf_template 5 $color05 -printf $printf_template 6 $color06 -printf $printf_template 7 $color07 -printf $printf_template 8 $color08 -printf $printf_template 9 $color09 -printf $printf_template 10 $color10 -printf $printf_template 11 $color11 -printf $printf_template 12 $color12 -printf $printf_template 13 $color13 -printf $printf_template 14 $color14 -printf $printf_template 15 $color15 - -# 256 color space -printf $printf_template 16 $color16 -printf $printf_template 17 $color17 -printf $printf_template 18 $color18 -printf $printf_template 19 $color19 -printf $printf_template 20 $color20 -printf $printf_template 21 $color21 - -# foreground / background / cursor color -if [ -n "$ITERM_SESSION_ID" ]; then - # iTerm2 proprietary escape codes - printf $printf_template_custom Pg <%= @base["05"]["hex"] %> # forground - printf $printf_template_custom Ph <%= @base["00"]["hex"] %> # background - printf $printf_template_custom Pi <%= @base["05"]["hex"] %> # bold color - printf $printf_template_custom Pj <%= @base["02"]["hex"] %> # selection color - printf $printf_template_custom Pk <%= @base["05"]["hex"] %> # selected text color - printf $printf_template_custom Pl <%= @base["05"]["hex"] %> # cursor - printf $printf_template_custom Pm <%= @base["00"]["hex"] %> # cursor text -else - printf $printf_template_var 10 $color_foreground - printf $printf_template_var 11 $color_background - printf $printf_template_custom 12 ";7" # cursor (reverse video) -fi - -# clean up -unset printf_template -unset printf_template_var -unset color00 -unset color01 -unset color02 -unset color03 -unset color04 -unset color05 -unset color06 -unset color07 -unset color08 -unset color09 -unset color10 -unset color11 -unset color12 -unset color13 -unset color14 -unset color15 -unset color16 -unset color17 -unset color18 -unset color19 -unset color20 -unset color21 -unset color_foreground -unset color_background -unset color_cursor -#!/bin/sh -# Base16 Donokai - Shell color setup script -# Daniel Flanagan(https://lytedev.io) - -if [ "${TERM%%-*}" = 'linux' ]; then - # This script doesn't support linux console (use 'vconsole' template instead) - return 2>/dev/null || exit 0 -fi - -color00="11/11/11" # Base 00 - Black -color01="f9/26/72" # Base 08 - Red -color02="a6/e2/2e" # Base 0B - Green -color03="f4/bf/75" # Base 0A - Yellow -color04="66/d9/ef" # Base 0D - Blue -color05="ae/81/ff" # Base 0E - Magenta -color06="a1/ef/e4" # Base 0C - Cyan -color07="f8/f8/f2" # Base 05 - White -color08="75/71/5e" # Base 03 - Bright Black -color09=$color01 # Base 08 - Bright Red -color10=$color02 # Base 0B - Bright Green -color11=$color03 # Base 0A - Bright Yellow -color12=$color04 # Base 0D - Bright Blue -color13=$color05 # Base 0E - Bright Magenta -color14=$color06 # Base 0C - Bright Cyan -color15="f9/f8/f5" # Base 07 - Bright White -color16="fd/97/1f" # Base 09 -color17="cc/66/33" # Base 0F -color18="38/38/30" # Base 01 -color19="49/48/3e" # Base 02 -color20="a5/9f/85" # Base 04 -color21="f5/f4/f1" # Base 06 -color_foreground="f8/f8/f2" # Base 05 -color_background="11/11/11" # Base 00 -color_cursor="f8/f8/f2" # Base 05 - -if [ -n "$TMUX" ]; then - # tell tmux to pass the escape sequences through - # (Source: http://permalink.gmane.org/gmane.comp.terminal-emulators.tmux.user/1324) - printf_template="\033Ptmux;\033\033]4;%d;rgb:%s\007\033\\" - printf_template_var="\033Ptmux;\033\033]%d;rgb:%s\007\033\\" - printf_template_custom="\033Ptmux;\033\033]%s%s\007\033\\" -elif [ "${TERM%%-*}" = "screen" ]; then - # GNU screen (screen, screen-256color, screen-256color-bce) - printf_template="\033P\033]4;%d;rgb:%s\007\033\\" - printf_template_var="\033P\033]%d;rgb:%s\007\033\\" - printf_template_custom="\033P\033]%s%s\007\033\\" -elif [[ $- != *i* ]]; then - # non-interactive - alias printf=/bin/false -else - printf_template="\033]4;%d;rgb:%s\033\\" - printf_template_var="\033]%d;rgb:%s\033\\" - printf_template_custom="\033]%s%s\033\\" -fi - -# 16 color space -printf $printf_template 0 $color00 -printf $printf_template 1 $color01 -printf $printf_template 2 $color02 -printf $printf_template 3 $color03 -printf $printf_template 4 $color04 -printf $printf_template 5 $color05 -printf $printf_template 6 $color06 -printf $printf_template 7 $color07 -printf $printf_template 8 $color08 -printf $printf_template 9 $color09 -printf $printf_template 10 $color10 -printf $printf_template 11 $color11 -printf $printf_template 12 $color12 -printf $printf_template 13 $color13 -printf $printf_template 14 $color14 -printf $printf_template 15 $color15 - -# 256 color space -printf $printf_template 16 $color16 -printf $printf_template 17 $color17 -printf $printf_template 18 $color18 -printf $printf_template 19 $color19 -printf $printf_template 20 $color20 -printf $printf_template 21 $color21 - -# foreground / background / cursor color -if [ -n "$ITERM_SESSION_ID" ]; then - # iTerm2 proprietary escape codes - printf $printf_template_custom Pg f8f8f2 # forground - printf $printf_template_custom Ph 111111 # background - printf $printf_template_custom Pi f8f8f2 # bold color - printf $printf_template_custom Pj 49483e # selection color - printf $printf_template_custom Pk f8f8f2 # selected text color - printf $printf_template_custom Pl f8f8f2 # cursor - printf $printf_template_custom Pm 111111 # cursor text -else - printf $printf_template_var 10 $color_foreground - printf $printf_template_var 11 $color_background - printf $printf_template_custom 12 ";7" # cursor (reverse video) -fi - -# clean up -unset printf_template -unset printf_template_var -unset color00 -unset color01 -unset color02 -unset color03 -unset color04 -unset color05 -unset color06 -unset color07 -unset color08 -unset color09 -unset color10 -unset color11 -unset color12 -unset color13 -unset color14 -unset color15 -unset color16 -unset color17 -unset color18 -unset color19 -unset color20 -unset color21 -unset color_foreground -unset color_background -unset color_cursor diff --git a/common/colors/generator/templates/shell.moon b/common/colors/generator/templates/shell.moon deleted file mode 100644 index f8e6372..0000000 --- a/common/colors/generator/templates/shell.moon +++ /dev/null @@ -1,255 +0,0 @@ -=> - color_map: (k, v) -> - r, g, b = v\match "(%d%d)(%d%d)(%d%d)" - k, "#{r}/#{g}/#{b}" - - content: [===[#!/bin/sh -# #{@.meta.name} by #{@.meta.author} %> - -if [ "${TERM%%-*}" = 'linux' ]; then - # This script doesn't support linux console (use 'vconsole' template instead) - return 2>/dev/null || exit 0 -fi - -color00="<%= split_by_slash(@base["00"]["hex"]) %>" # Base 00 - Black -color01="<%= split_by_slash(@base["08"]["hex"]) %>" # Base 08 - Red -color02="<%= split_by_slash(@base["0B"]["hex"]) %>" # Base 0B - Green -color03="<%= split_by_slash(@base["0A"]["hex"]) %>" # Base 0A - Yellow -color04="<%= split_by_slash(@base["0D"]["hex"]) %>" # Base 0D - Blue -color05="<%= split_by_slash(@base["0E"]["hex"]) %>" # Base 0E - Magenta -color06="<%= split_by_slash(@base["0C"]["hex"]) %>" # Base 0C - Cyan -color07="<%= split_by_slash(@base["05"]["hex"]) %>" # Base 05 - White -color08="<%= split_by_slash(@base["03"]["hex"]) %>" # Base 03 - Bright Black -color09=$color01 # Base 08 - Bright Red -color10=$color02 # Base 0B - Bright Green -color11=$color03 # Base 0A - Bright Yellow -color12=$color04 # Base 0D - Bright Blue -color13=$color05 # Base 0E - Bright Magenta -color14=$color06 # Base 0C - Bright Cyan -color15="<%= split_by_slash(@base["07"]["hex"]) %>" # Base 07 - Bright White -color16="<%= split_by_slash(@base["09"]["hex"]) %>" # Base 09 -color17="<%= split_by_slash(@base["0F"]["hex"]) %>" # Base 0F -color18="<%= split_by_slash(@base["01"]["hex"]) %>" # Base 01 -color19="<%= split_by_slash(@base["02"]["hex"]) %>" # Base 02 -color20="<%= split_by_slash(@base["04"]["hex"]) %>" # Base 04 -color21="<%= split_by_slash(@base["06"]["hex"]) %>" # Base 06 -color_foreground="<%= split_by_slash(@base["05"]["hex"]) %>" # Base 05 -color_background="<%= split_by_slash(@base["00"]["hex"]) %>" # Base 00 -color_cursor="<%= split_by_slash(@base["05"]["hex"]) %>" # Base 05 - -if [ -n "$TMUX" ]; then - # tell tmux to pass the escape sequences through - # (Source: http://permalink.gmane.org/gmane.comp.terminal-emulators.tmux.user/1324) - printf_template="\033Ptmux;\033\033]4;%d;rgb:%s\007\033\\" - printf_template_var="\033Ptmux;\033\033]%d;rgb:%s\007\033\\" - printf_template_custom="\033Ptmux;\033\033]%s%s\007\033\\" -elif [ "${TERM%%-*}" = "screen" ]; then - # GNU screen (screen, screen-256color, screen-256color-bce) - printf_template="\033P\033]4;%d;rgb:%s\007\033\\" - printf_template_var="\033P\033]%d;rgb:%s\007\033\\" - printf_template_custom="\033P\033]%s%s\007\033\\" -elif [[ $- != *i* ]]; then - # non-interactive - alias printf=/bin/false -else - printf_template="\033]4;%d;rgb:%s\033\\" - printf_template_var="\033]%d;rgb:%s\033\\" - printf_template_custom="\033]%s%s\033\\" -fi - -# 16 color space -printf $printf_template 0 $color00 -printf $printf_template 1 $color01 -printf $printf_template 2 $color02 -printf $printf_template 3 $color03 -printf $printf_template 4 $color04 -printf $printf_template 5 $color05 -printf $printf_template 6 $color06 -printf $printf_template 7 $color07 -printf $printf_template 8 $color08 -printf $printf_template 9 $color09 -printf $printf_template 10 $color10 -printf $printf_template 11 $color11 -printf $printf_template 12 $color12 -printf $printf_template 13 $color13 -printf $printf_template 14 $color14 -printf $printf_template 15 $color15 - -# 256 color space -printf $printf_template 16 $color16 -printf $printf_template 17 $color17 -printf $printf_template 18 $color18 -printf $printf_template 19 $color19 -printf $printf_template 20 $color20 -printf $printf_template 21 $color21 - -# foreground / background / cursor color -if [ -n "$ITERM_SESSION_ID" ]; then - # iTerm2 proprietary escape codes - printf $printf_template_custom Pg <%= @base["05"]["hex"] %> # forground - printf $printf_template_custom Ph <%= @base["00"]["hex"] %> # background - printf $printf_template_custom Pi <%= @base["05"]["hex"] %> # bold color - printf $printf_template_custom Pj <%= @base["02"]["hex"] %> # selection color - printf $printf_template_custom Pk <%= @base["05"]["hex"] %> # selected text color - printf $printf_template_custom Pl <%= @base["05"]["hex"] %> # cursor - printf $printf_template_custom Pm <%= @base["00"]["hex"] %> # cursor text -else - printf $printf_template_var 10 $color_foreground - printf $printf_template_var 11 $color_background - printf $printf_template_custom 12 ";7" # cursor (reverse video) -fi - -# clean up -unset printf_template -unset printf_template_var -unset color00 -unset color01 -unset color02 -unset color03 -unset color04 -unset color05 -unset color06 -unset color07 -unset color08 -unset color09 -unset color10 -unset color11 -unset color12 -unset color13 -unset color14 -unset color15 -unset color16 -unset color17 -unset color18 -unset color19 -unset color20 -unset color21 -unset color_foreground -unset color_background -unset color_cursor -#!/bin/sh -# Base16 Donokai - Shell color setup script -# Daniel Flanagan(https://lytedev.io) - -if [ "${TERM%%-*}" = 'linux' ]; then - # This script doesn't support linux console (use 'vconsole' template instead) - return 2>/dev/null || exit 0 -fi - -color00="11/11/11" # Base 00 - Black -color01="f9/26/72" # Base 08 - Red -color02="a6/e2/2e" # Base 0B - Green -color03="f4/bf/75" # Base 0A - Yellow -color04="66/d9/ef" # Base 0D - Blue -color05="ae/81/ff" # Base 0E - Magenta -color06="a1/ef/e4" # Base 0C - Cyan -color07="f8/f8/f2" # Base 05 - White -color08="75/71/5e" # Base 03 - Bright Black -color09=$color01 # Base 08 - Bright Red -color10=$color02 # Base 0B - Bright Green -color11=$color03 # Base 0A - Bright Yellow -color12=$color04 # Base 0D - Bright Blue -color13=$color05 # Base 0E - Bright Magenta -color14=$color06 # Base 0C - Bright Cyan -color15="f9/f8/f5" # Base 07 - Bright White -color16="fd/97/1f" # Base 09 -color17="cc/66/33" # Base 0F -color18="38/38/30" # Base 01 -color19="49/48/3e" # Base 02 -color20="a5/9f/85" # Base 04 -color21="f5/f4/f1" # Base 06 -color_foreground="f8/f8/f2" # Base 05 -color_background="11/11/11" # Base 00 -color_cursor="f8/f8/f2" # Base 05 - -if [ -n "$TMUX" ]; then - # tell tmux to pass the escape sequences through - # (Source: http://permalink.gmane.org/gmane.comp.terminal-emulators.tmux.user/1324) - printf_template="\033Ptmux;\033\033]4;%d;rgb:%s\007\033\\" - printf_template_var="\033Ptmux;\033\033]%d;rgb:%s\007\033\\" - printf_template_custom="\033Ptmux;\033\033]%s%s\007\033\\" -elif [ "${TERM%%-*}" = "screen" ]; then - # GNU screen (screen, screen-256color, screen-256color-bce) - printf_template="\033P\033]4;%d;rgb:%s\007\033\\" - printf_template_var="\033P\033]%d;rgb:%s\007\033\\" - printf_template_custom="\033P\033]%s%s\007\033\\" -elif [[ $- != *i* ]]; then - # non-interactive - alias printf=/bin/false -else - printf_template="\033]4;%d;rgb:%s\033\\" - printf_template_var="\033]%d;rgb:%s\033\\" - printf_template_custom="\033]%s%s\033\\" -fi - -# 16 color space -printf $printf_template 0 $color00 -printf $printf_template 1 $color01 -printf $printf_template 2 $color02 -printf $printf_template 3 $color03 -printf $printf_template 4 $color04 -printf $printf_template 5 $color05 -printf $printf_template 6 $color06 -printf $printf_template 7 $color07 -printf $printf_template 8 $color08 -printf $printf_template 9 $color09 -printf $printf_template 10 $color10 -printf $printf_template 11 $color11 -printf $printf_template 12 $color12 -printf $printf_template 13 $color13 -printf $printf_template 14 $color14 -printf $printf_template 15 $color15 - -# 256 color space -printf $printf_template 16 $color16 -printf $printf_template 17 $color17 -printf $printf_template 18 $color18 -printf $printf_template 19 $color19 -printf $printf_template 20 $color20 -printf $printf_template 21 $color21 - -# foreground / background / cursor color -if [ -n "$ITERM_SESSION_ID" ]; then - # iTerm2 proprietary escape codes - printf $printf_template_custom Pg f8f8f2 # forground - printf $printf_template_custom Ph 111111 # background - printf $printf_template_custom Pi f8f8f2 # bold color - printf $printf_template_custom Pj 49483e # selection color - printf $printf_template_custom Pk f8f8f2 # selected text color - printf $printf_template_custom Pl f8f8f2 # cursor - printf $printf_template_custom Pm 111111 # cursor text -else - printf $printf_template_var 10 $color_foreground - printf $printf_template_var 11 $color_background - printf $printf_template_custom 12 ";7" # cursor (reverse video) -fi - -# clean up -unset printf_template -unset printf_template_var -unset color00 -unset color01 -unset color02 -unset color03 -unset color04 -unset color05 -unset color06 -unset color07 -unset color08 -unset color09 -unset color10 -unset color11 -unset color12 -unset color13 -unset color14 -unset color15 -unset color16 -unset color17 -unset color18 -unset color19 -unset color20 -unset color21 -unset color_foreground -unset color_background -unset color_cursor -]===] diff --git a/common/colors/set-theme.bash b/common/colors/set-theme.bash deleted file mode 100755 index 1fd3de9..0000000 --- a/common/colors/set-theme.bash +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -DIR=$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd) - -THEME="$1" - -echo "$THEME" - -"$DIR/generator/gen.bash" "$THEME" -"$DOTFILES_PATH/apps/de/x/loadresources" -resrc -restartbar -# TODO: set GTK theme to "Arc-Dark" or "Arc-Light" diff --git a/common/colors/shell b/common/colors/shell index ebeb6fc..889f8fb 100755 --- a/common/colors/shell +++ b/common/colors/shell @@ -1,37 +1,27 @@ #!/bin/sh -# Base16 Donokai - Shell color setup script -# Daniel Flanagan(https://lytedev.io) if [ "${TERM%%-*}" = 'linux' ]; then - # This script doesn't support linux console (use 'vconsole' template instead) - return 2>/dev/null || exit 0 + return 2>/dev/null || exit 0 fi -color00="11/11/11" # Base 00 - Black -color01="f9/26/72" # Base 08 - Red -color02="a6/e2/2e" # Base 0B - Green -color03="f4/bf/75" # Base 0A - Yellow -color04="66/d9/ef" # Base 0D - Blue -color05="ae/81/ff" # Base 0E - Magenta -color06="a1/ef/e4" # Base 0C - Cyan -color07="f8/f8/f2" # Base 05 - White -color08="75/71/5e" # Base 03 - Bright Black -color09=$color01 # Base 08 - Bright Red -color10=$color02 # Base 0B - Bright Green -color11=$color03 # Base 0A - Bright Yellow -color12=$color04 # Base 0D - Bright Blue -color13=$color05 # Base 0E - Bright Magenta -color14=$color06 # Base 0C - Bright Cyan -color15="f9/f8/f5" # Base 07 - Bright White +black="11/11/11" +red="f9/26/72" +green="a6/e2/2e" +yellow="f4/bf/75" +blue="66/d9/ef" +magenta="ae/81/ff" +cyan="a1/ef/e4" +white="cccccc" +black2="75/71/5e" +white2="f8/f8/f8" + +# TODO: name these? color16="fd/97/1f" # Base 09 color17="cc/66/33" # Base 0F color18="38/38/30" # Base 01 color19="49/48/3e" # Base 02 color20="a5/9f/85" # Base 04 color21="f5/f4/f1" # Base 06 -color_foreground="f8/f8/f2" # Base 05 -color_background="11/11/11" # Base 00 -color_cursor="f8/f8/f2" # Base 05 if [ -n "$TMUX" ]; then # tell tmux to pass the escape sequences through @@ -53,33 +43,36 @@ else printf_template_custom="\033]%s%s\033\\" fi -# 16 color space -printf $printf_template 0 $color00 -printf $printf_template 1 $color01 -printf $printf_template 2 $color02 -printf $printf_template 3 $color03 -printf $printf_template 4 $color04 -printf $printf_template 5 $color05 -printf $printf_template 6 $color06 -printf $printf_template 7 $color07 -printf $printf_template 8 $color08 -printf $printf_template 9 $color09 -printf $printf_template 10 $color10 -printf $printf_template 11 $color11 -printf $printf_template 12 $color12 -printf $printf_template 13 $color13 -printf $printf_template 14 $color14 -printf $printf_template 15 $color15 +c() { + t="${1}"; shift + c="${1}"; shift + for n in "$@"; do + printf "$t" "$n" "$c" + done +} -# 256 color space -printf $printf_template 16 $color16 -printf $printf_template 17 $color17 -printf $printf_template 18 $color18 -printf $printf_template 19 $color19 -printf $printf_template 20 $color20 -printf $printf_template 21 $color21 +ct() { c "$printf_template" "$@"; } +cv() { c "$printf_template" "$@"; } +cc() { c "$printf_template" "$@"; } + +ct $black 0 +ct $red 1 9 +ct $green 2 10 +ct $yellow 3 11 +ct $blue 4 12 +ct $magenta 5 13 +ct $cyan 6 14 +ct $white 7 10 +ct $black2 8 +ct $white2 15 + +ct $color16 16 +ct $color17 17 +ct $color18 18 +ct $color19 19 +ct $color20 20 +ct $color21 21 -# foreground / background / cursor color if [ -n "$ITERM_SESSION_ID" ]; then # iTerm2 proprietary escape codes printf $printf_template_custom Pg f8f8f2 # forground @@ -90,36 +83,33 @@ if [ -n "$ITERM_SESSION_ID" ]; then printf $printf_template_custom Pl f8f8f2 # cursor printf $printf_template_custom Pm 111111 # cursor text else - printf $printf_template_var 10 $color_foreground - printf $printf_template_var 11 $color_background - printf $printf_template_custom 12 ";7" # cursor (reverse video) + cv $white 10 + cv $black 11 + cc ";7" 12 fi -# clean up +unset -f c +unset -f ct +unset -f cv +unset -f cc + +unset black +unset red +unset green +unset yellow +unset blue +unset magenta +unset cyan +unset white +unset black2 +unset white2 + unset printf_template unset printf_template_var -unset color00 -unset color01 -unset color02 -unset color03 -unset color04 -unset color05 -unset color06 -unset color07 -unset color08 -unset color09 -unset color10 -unset color11 -unset color12 -unset color13 -unset color14 -unset color15 +unset printf_template_custom unset color16 unset color17 unset color18 unset color19 unset color20 unset color21 -unset color_foreground -unset color_background -unset color_cursor diff --git a/common/colors/vconsole b/common/colors/vconsole index f742227..02e23c1 100755 --- a/common/colors/vconsole +++ b/common/colors/vconsole @@ -1,62 +1,48 @@ #!/bin/sh -# Base16 Donokai - Virtual console color setup script -# Daniel Flanagan(https://lytedev.io) -color00="111111" # Base 00 - Black -color01="f92672" # Base 08 - Red -color02="a6e22e" # Base 0B - Green -color03="f4bf75" # Base 0A - Yellow -color04="66d9ef" # Base 0D - Blue -color05="ae81ff" # Base 0E - Magenta -color06="a1efe4" # Base 0C - Cyan -color07="f8f8f2" # Base 05 - White -color08="75715e" # Base 03 - Bright Black -color09=$color01 # Base 08 - Bright Red -color10=$color02 # Base 0B - Bright Green -color11=$color03 # Base 0A - Bright Yellow -color12=$color04 # Base 0D - Bright Blue -color13=$color05 # Base 0E - Bright Magenta -color14=$color06 # Base 0C - Bright Cyan -color15="f9f8f5" # Base 07 - Bright White +black="111111" # black +red="f92672" # red +green="a6e22e" # green +yellow="f4bf75" # yellow +blue="66d9ef" # blue +magenta="ae81ff" # magenta +cyan="a1efe4" # cyan +white="cccccc" # white +black2="75715e" # black +white2="f8f8f8" # white -# 16 color space -echo -e "\e]P0$color00" -echo -e "\e]P1$color01" -echo -e "\e]P2$color02" -echo -e "\e]P3$color03" -echo -e "\e]P4$color04" -echo -e "\e]P5$color05" -echo -e "\e]P6$color06" -echo -e "\e]P7$color07" -echo -e "\e]P8$color08" -echo -e "\e]P9$color09" -echo -e "\e]PA$color10" -echo -e "\e]PB$color11" -echo -e "\e]PC$color12" -echo -e "\e]PD$color13" -echo -e "\e]PE$color14" -echo -e "\e]PF$color15" -if [ -x /sbin/clear ]; then +c() { + c="${1}"; shift + for n in "$@"; do + echo -e "\e]P${n}${c}"; + done +} + +c $black 0 +c $red 1 9 +c $green 2 A +c $yellow 3 B +c $blue 4 C +c $magenta 5 D +c $cyan 6 E +c $white 7 +c $black2 8 +c $white2 F + +if [ -x /sbin/clear ]; then /sbin/clear else - echo -e "\e[H" - echo -e "\e[2J" + echo -e "\e[H\e[2J" fi -# clean up -unset color00 -unset color01 -unset color02 -unset color03 -unset color04 -unset color05 -unset color06 -unset color07 -unset color08 -unset color09 -unset color10 -unset color11 -unset color12 -unset color13 -unset color14 -unset color15 +unset -f c +unset black +unset red +unset green +unset yellow +unset blue +unset magenta +unset cyan +unset white +unset black2 +unset white2 diff --git a/common/colors/vim b/common/colors/vim deleted file mode 100644 index f05d312..0000000 --- a/common/colors/vim +++ /dev/null @@ -1,302 +0,0 @@ -let s:gui00 = "111111" -let s:gui01 = "383830" -let s:gui02 = "49483e" -let s:gui03 = "75715e" -let s:gui04 = "a59f85" -let s:gui05 = "f8f8f2" -let s:gui06 = "f5f4f1" -let s:gui07 = "f9f8f5" -let s:gui08 = "f92672" -let s:gui09 = "fd971f" -let s:gui0A = "f4bf75" -let s:gui0B = "a6e22e" -let s:gui0C = "a1efe4" -let s:gui0D = "66d9ef" -let s:gui0E = "ae81ff" -let s:gui0F = "cc6633" - -" Terminal color definitions -let s:cterm00 = "00" -let s:cterm03 = "08" -let s:cterm05 = "07" -let s:cterm07 = "15" -let s:cterm08 = "01" -let s:cterm0A = "03" -let s:cterm0B = "02" -let s:cterm0C = "06" -let s:cterm0D = "04" -let s:cterm0E = "05" -if exists('base16colorspace') && base16colorspace == "256" - let s:cterm01 = "18" - let s:cterm02 = "19" - let s:cterm04 = "20" - let s:cterm06 = "21" - let s:cterm09 = "16" - let s:cterm0F = "17" -else - let s:cterm01 = "10" - let s:cterm02 = "11" - let s:cterm04 = "12" - let s:cterm06 = "13" - let s:cterm09 = "09" - let s:cterm0F = "14" -endif - -" Theme setup -hi clear -syntax reset -let g:colors_name = "base16-donokai" - -" Highlighting function -fun hi(group, guifg, guibg, ctermfg, ctermbg, attr, guisp) - if a:guifg != "" - exec "hi " . a:group . " guifg=#" . s:gui(a:guifg) - endif - if a:guibg != "" - exec "hi " . a:group . " guibg=#" . s:gui(a:guibg) - endif - if a:ctermfg != "" - exec "hi " . a:group . " ctermfg=" . s:cterm(a:ctermfg) - endif - if a:ctermbg != "" - exec "hi " . a:group . " ctermbg=" . s:cterm(a:ctermbg) - endif - if a:attr != "" - exec "hi " . a:group . " gui=" . a:attr . " cterm=" . a:attr - endif - if a:guisp != "" - exec "hi " . a:group . " guisp=#" . a:guisp - endif -endfun - -" Return GUI color for light/dark variants -fun s:gui(color) - if &background == "dark" - return a:color - endif - - if a:color == s:gui00 - return s:gui07 - elseif a:color == s:gui01 - return s:gui06 - elseif a:color == s:gui02 - return s:gui05 - elseif a:color == s:gui03 - return s:gui04 - elseif a:color == s:gui04 - return s:gui03 - elseif a:color == s:gui05 - return s:gui02 - elseif a:color == s:gui06 - return s:gui01 - elseif a:color == s:gui07 - return s:gui00 - endif - - return a:color -endfun - -" Return terminal color for light/dark variants -fun s:cterm(color) - if &background == "dark" - return a:color - endif - - if a:color == s:cterm00 - return s:cterm07 - elseif a:color == s:cterm01 - return s:cterm06 - elseif a:color == s:cterm02 - return s:cterm05 - elseif a:color == s:cterm03 - return s:cterm04 - elseif a:color == s:cterm04 - return s:cterm03 - elseif a:color == s:cterm05 - return s:cterm02 - elseif a:color == s:cterm06 - return s:cterm01 - elseif a:color == s:cterm07 - return s:cterm00 - endif - - return a:color -endfun - -" Vim editor colors -call hi("Bold", "", "", "", "", "bold", "") -call hi("Debug", s:gui08, "", s:cterm08, "", "", "") -call hi("Directory", s:gui0D, "", s:cterm0D, "", "", "") -call hi("Error", s:gui00, s:gui08, s:cterm00, s:cterm08, "", "") -call hi("ErrorMsg", s:gui08, s:gui00, s:cterm08, s:cterm00, "", "") -call hi("Exception", s:gui08, "", s:cterm08, "", "", "") -call hi("FoldColumn", s:gui0C, s:gui01, s:cterm0C, s:cterm01, "", "") -call hi("Folded", s:gui03, s:gui01, s:cterm03, s:cterm01, "", "") -call hi("IncSearch", s:gui01, s:gui09, s:cterm01, s:cterm09, "none", "") -call hi("Italic", "", "", "", "", "none", "") -call hi("Macro", s:gui08, "", s:cterm08, "", "", "") -call hi("MatchParen", s:gui00, s:gui03, s:cterm00, s:cterm03, "", "") -call hi("ModeMsg", s:gui0B, "", s:cterm0B, "", "", "") -call hi("MoreMsg", s:gui0B, "", s:cterm0B, "", "", "") -call hi("Question", s:gui0D, "", s:cterm0D, "", "", "") -call hi("Search", s:gui03, s:gui0A, s:cterm03, s:cterm0A, "", "") -call hi("SpecialKey", s:gui03, "", s:cterm03, "", "", "") -call hi("TooLong", s:gui08, "", s:cterm08, "", "", "") -call hi("Underlined", s:gui08, "", s:cterm08, "", "", "") -call hi("Visual", "", s:gui02, "", s:cterm02, "", "") -call hi("VisualNOS", s:gui08, "", s:cterm08, "", "", "") -call hi("WarningMsg", s:gui08, "", s:cterm08, "", "", "") -call hi("WildMenu", s:gui08, s:gui0A, s:cterm08, "", "", "") -call hi("Title", s:gui0D, "", s:cterm0D, "", "none", "") -call hi("Conceal", s:gui0D, s:gui00, s:cterm0D, s:cterm00, "", "") -call hi("Cursor", s:gui00, s:gui05, s:cterm00, s:cterm05, "", "") -call hi("NonText", s:gui03, "", s:cterm03, "", "", "") -call hi("Normal", s:gui05, s:gui00, s:cterm05, s:cterm00, "", "") -call hi("LineNr", s:gui03, s:gui01, s:cterm03, s:cterm01, "", "") -call hi("SignColumn", s:gui03, s:gui01, s:cterm03, s:cterm01, "", "") -call hi("StatusLine", s:gui04, s:gui02, s:cterm04, s:cterm02, "none", "") -call hi("StatusLineNC", s:gui03, s:gui01, s:cterm03, s:cterm01, "none", "") -call hi("VertSplit", s:gui02, s:gui02, s:cterm02, s:cterm02, "none", "") -call hi("ColorColumn", "", s:gui01, "", s:cterm01, "none", "") -call hi("CursorColumn", "", s:gui01, "", s:cterm01, "none", "") -call hi("CursorLine", "", s:gui01, "", s:cterm01, "none", "") -call hi("CursorLineNr", s:gui03, s:gui01, s:cterm03, s:cterm01, "", "") -call hi("PMenu", s:gui04, s:gui01, s:cterm04, s:cterm01, "none", "") -call hi("PMenuSel", s:gui01, s:gui04, s:cterm01, s:cterm04, "", "") -call hi("TabLine", s:gui03, s:gui01, s:cterm03, s:cterm01, "none", "") -call hi("TabLineFill", s:gui03, s:gui01, s:cterm03, s:cterm01, "none", "") -call hi("TabLineSel", s:gui0B, s:gui01, s:cterm0B, s:cterm01, "none", "") - -" Standard syntax highlighting -call hi("Boolean", s:gui09, "", s:cterm09, "", "", "") -call hi("Character", s:gui08, "", s:cterm08, "", "", "") -call hi("Comment", s:gui03, "", s:cterm03, "", "", "") -call hi("Conditional", s:gui0E, "", s:cterm0E, "", "", "") -call hi("Constant", s:gui09, "", s:cterm09, "", "", "") -call hi("Define", s:gui0E, "", s:cterm0E, "", "none", "") -call hi("Delimiter", s:gui0F, "", s:cterm0F, "", "", "") -call hi("Float", s:gui09, "", s:cterm09, "", "", "") -call hi("Function", s:gui0D, "", s:cterm0D, "", "", "") -call hi("Identifier", s:gui08, "", s:cterm08, "", "none", "") -call hi("Include", s:gui0D, "", s:cterm0D, "", "", "") -call hi("Keyword", s:gui0E, "", s:cterm0E, "", "", "") -call hi("Label", s:gui0A, "", s:cterm0A, "", "", "") -call hi("Number", s:gui09, "", s:cterm09, "", "", "") -call hi("Operator", s:gui05, "", s:cterm05, "", "none", "") -call hi("PreProc", s:gui0A, "", s:cterm0A, "", "", "") -call hi("Repeat", s:gui0A, "", s:cterm0A, "", "", "") -call hi("Special", s:gui0C, "", s:cterm0C, "", "", "") -call hi("SpecialChar", s:gui0F, "", s:cterm0F, "", "", "") -call hi("Statement", s:gui08, "", s:cterm08, "", "", "") -call hi("StorageClass", s:gui0A, "", s:cterm0A, "", "", "") -call hi("String", s:gui0B, "", s:cterm0B, "", "", "") -call hi("Structure", s:gui0E, "", s:cterm0E, "", "", "") -call hi("Tag", s:gui0A, "", s:cterm0A, "", "", "") -call hi("Todo", s:gui0A, s:gui01, s:cterm0A, s:cterm01, "", "") -call hi("Type", s:gui0A, "", s:cterm0A, "", "none", "") -call hi("Typedef", s:gui0A, "", s:cterm0A, "", "", "") - -" C highlighting -call hi("cOperator", s:gui0C, "", s:cterm0C, "", "", "") -call hi("cPreCondit", s:gui0E, "", s:cterm0E, "", "", "") - -" C# highlighting -call hi("csClass", s:gui0A, "", s:cterm0A, "", "", "") -call hi("csAttribute", s:gui0A, "", s:cterm0A, "", "", "") -call hi("csModifier", s:gui0E, "", s:cterm0E, "", "", "") -call hi("csType", s:gui08, "", s:cterm08, "", "", "") -call hi("csUnspecifiedStatement", s:gui0D, "", s:cterm0D, "", "", "") -call hi("csContextualStatement", s:gui0E, "", s:cterm0E, "", "", "") -call hi("csNewDecleration", s:gui08, "", s:cterm08, "", "", "") - -" CSS highlighting -call hi("cssBraces", s:gui05, "", s:cterm05, "", "", "") -call hi("cssClassName", s:gui0E, "", s:cterm0E, "", "", "") -call hi("cssColor", s:gui0C, "", s:cterm0C, "", "", "") - -" Diff highlighting -call hi("DiffAdd", s:gui0B, s:gui01, s:cterm0B, s:cterm01, "", "") -call hi("DiffChange", s:gui03, s:gui01, s:cterm03, s:cterm01, "", "") -call hi("DiffDelete", s:gui08, s:gui01, s:cterm08, s:cterm01, "", "") -call hi("DiffText", s:gui0D, s:gui01, s:cterm0D, s:cterm01, "", "") -call hi("DiffAdded", s:gui0B, s:gui00, s:cterm0B, s:cterm00, "", "") -call hi("DiffFile", s:gui08, s:gui00, s:cterm08, s:cterm00, "", "") -call hi("DiffNewFile", s:gui0B, s:gui00, s:cterm0B, s:cterm00, "", "") -call hi("DiffLine", s:gui0D, s:gui00, s:cterm0D, s:cterm00, "", "") -call hi("DiffRemoved", s:gui08, s:gui00, s:cterm08, s:cterm00, "", "") - -" Git highlighting -call hi("gitCommitOverflow", s:gui08, "", s:cterm08, "", "", "") -call hi("gitCommitSummary", s:gui0B, "", s:cterm0B, "", "", "") - -" GitGutter highlighting -call hi("GitGutterAdd", s:gui0B, s:gui01, s:cterm0B, s:cterm01, "", "") -call hi("GitGutterChange", s:gui0D, s:gui01, s:cterm0D, s:cterm01, "", "") -call hi("GitGutterDelete", s:gui08, s:gui01, s:cterm08, s:cterm01, "", "") -call hi("GitGutterChangeDelete", s:gui0E, s:gui01, s:cterm0E, s:cterm01, "", "") - -" HTML highlighting -call hi("htmlBold", s:gui0A, "", s:cterm0A, "", "", "") -call hi("htmlItalic", s:gui0E, "", s:cterm0E, "", "", "") -call hi("htmlEndTag", s:gui05, "", s:cterm05, "", "", "") -call hi("htmlTag", s:gui05, "", s:cterm05, "", "", "") - -" JavaScript highlighting -call hi("javaScript", s:gui05, "", s:cterm05, "", "", "") -call hi("javaScriptBraces", s:gui05, "", s:cterm05, "", "", "") -call hi("javaScriptNumber", s:gui09, "", s:cterm09, "", "", "") - -" Markdown highlighting -call hi("markdownCode", s:gui0B, "", s:cterm0B, "", "", "") -call hi("markdownError", s:gui05, s:gui00, s:cterm05, s:cterm00, "", "") -call hi("markdownCodeBlock", s:gui0B, "", s:cterm0B, "", "", "") -call hi("markdownHeadingDelimiter", s:gui0D, "", s:cterm0D, "", "", "") - -" NERDTree highlighting -call hi("NERDTreeDirSlash", s:gui0D, "", s:cterm0D, "", "", "") -call hi("NERDTreeExecFile", s:gui05, "", s:cterm05, "", "", "") - -" PHP highlighting -call hi("phpMemberSelector", s:gui05, "", s:cterm05, "", "", "") -call hi("phpComparison", s:gui05, "", s:cterm05, "", "", "") -call hi("phpParent", s:gui05, "", s:cterm05, "", "", "") - -" Python highlighting -call hi("pythonOperator", s:gui0E, "", s:cterm0E, "", "", "") -call hi("pythonRepeat", s:gui0E, "", s:cterm0E, "", "", "") - -" Ruby highlighting -call hi("rubyAttribute", s:gui0D, "", s:cterm0D, "", "", "") -call hi("rubyConstant", s:gui0A, "", s:cterm0A, "", "", "") -call hi("rubyInterpolation", s:gui0B, "", s:cterm0B, "", "", "") -call hi("rubyInterpolationDelimiter", s:gui0F, "", s:cterm0F, "", "", "") -call hi("rubyRegexp", s:gui0C, "", s:cterm0C, "", "", "") -call hi("rubySymbol", s:gui0B, "", s:cterm0B, "", "", "") -call hi("rubyStringDelimiter", s:gui0B, "", s:cterm0B, "", "", "") - -" SASS highlighting -call hi("sassidChar", s:gui08, "", s:cterm08, "", "", "") -call hi("sassClassChar", s:gui09, "", s:cterm09, "", "", "") -call hi("sassInclude", s:gui0E, "", s:cterm0E, "", "", "") -call hi("sassMixing", s:gui0E, "", s:cterm0E, "", "", "") -call hi("sassMixinName", s:gui0D, "", s:cterm0D, "", "", "") - -" Signify highlighting -call hi("SignifySignAdd", s:gui0B, s:gui01, s:cterm0B, s:cterm01, "", "") -call hi("SignifySignChange", s:gui0D, s:gui01, s:cterm0D, s:cterm01, "", "") -call hi("SignifySignDelete", s:gui08, s:gui01, s:cterm08, s:cterm01, "", "") - -" Spelling highlighting -call hi("SpellBad", "", s:gui00, "", s:cterm00, "undercurl", s:gui08) -call hi("SpellLocal", "", s:gui00, "", s:cterm00, "undercurl", s:gui0C) -call hi("SpellCap", "", s:gui00, "", s:cterm00, "undercurl", s:gui0D) -call hi("SpellRare", "", s:gui00, "", s:cterm00, "undercurl", s:gui0E) - -" Remove functions -delf hi -delf gui -delf cterm - -" Remove color variables -unlet s:gui00 s:gui01 s:gui02 s:gui03 s:gui04 s:gui05 s:gui06 s:gui07 s:gui08 s:gui09 s:gui0A s:gui0B s:gui0C s:gui0D s:gui0E s:gui0F -unlet s:cterm00 s:cterm01 s:cterm02 s:cterm03 s:cterm04 s:cterm05 s:cterm06 s:cterm07 s:cterm08 s:cterm09 s:cterm0A s:cterm0B s:cterm0C s:cterm0D s:cterm0E s:cterm0F diff --git a/common/colors/xresources b/common/colors/xresources deleted file mode 100644 index c524547..0000000 --- a/common/colors/xresources +++ /dev/null @@ -1,52 +0,0 @@ -! Base16 Donokai -! Scheme: Daniel Flanagan(https://lytedev.io) - -#define base00 #111111 -#define base01 #383830 -#define base02 #49483e -#define base03 #75715e -#define base04 #a59f85 -#define base05 #f8f8f2 -#define base06 #f5f4f1 -#define base07 #f9f8f5 -#define base08 #f92672 -#define base09 #fd971f -#define base0A #f4bf75 -#define base0B #a6e22e -#define base0C #a1efe4 -#define base0D #66d9ef -#define base0E #ae81ff -#define base0F #cc6633 - -*foreground: base05 -*background: base00 -*cursorColor: base05 - -*color0: base00 -*color1: base08 -*color2: base0B -*color3: base0A -*color4: base0D -*color5: base0E -*color6: base0C -*color7: base05 - -*color8: base03 -*color9: base09 -*color10: base01 -*color11: base02 -*color12: base04 -*color13: base06 -*color14: base0F -*color15: base07 - -rofi.color-window: base00,base0D,base05,base00 -rofi.color-normal: base00,base05,base00,base0D,base00 -rofi.color-normal: base00,base05,base00,base0D,base00 -rofi.color-active: base00,base05,base00,base0D,base00 -rofi.color-urgent: base00,base05,base00,base0D,base00 - -bspwm.normal_border_color: base00 -bspwm.focused_border_color: base0D -bspwm.active_border_color: base00 -bspwm.presel_feedback_color: base0D diff --git a/common/neovim/.gitignore b/common/neovim/.gitignore index 030b11f..d2d6e35 100644 --- a/common/neovim/.gitignore +++ b/common/neovim/.gitignore @@ -5,3 +5,4 @@ !/ftplugin !/lua !/coc-settings.json +!/colors/donokai.vim diff --git a/common/neovim/init.lua b/common/neovim/init.lua index 001b02e..e56ac36 100644 --- a/common/neovim/init.lua +++ b/common/neovim/init.lua @@ -1,41 +1,33 @@ -local kmap = vim.api.nvim_set_keymap -local excmd = vim.api.nvim_command -local nvim_exec = vim.api.nvim_exec +vim.g.vimdir = os.getenv('XDG_CONFIG_HOME') .. '/nvim' -- TODO: learn about the wildmenu `q:` -- TODO: what is `let &fcs = 'eob: '` for? -local evalvim = function(vimscript, output) - if (output == nil) then - output = false - end - nvim_exec(vimscript, output) -end - require('plugins').setup() require'options' require'keymap' +require('fold').setup() +-- require('lsp').setup() +require('statusline').setup() -do - local plugin_setups = { - telescope = { - defaults = { - mappings = {i = {['c-u'] = false, ['c-d'] = false}}, - generic_sorter = require('telescope.sorters').get_fzy_sorter, - file_sorter = require('telescope.sorters').get_fzy_sorter, - } - }, - fold = true, - statusline = true, - lsp = true, - } - for k,v in pairs(plugin_setups) do - if type(v) == 'function' then - v(require(k)) - elseif type(v) == 'table' then - require(k).setup(v) - elseif v == true then - require(k).setup() - end +local plugin_setups = { + telescope = { + defaults = { + mappings = {i = {['c-u'] = false, ['c-d'] = false}}, + generic_sorter = require('telescope.sorters').get_fzy_sorter, + file_sorter = require('telescope.sorters').get_fzy_sorter, + } + }, +} + +for k,v in pairs(plugin_setups) do + if type(v) == 'function' then + v(require(k)) + elseif type(v) == 'table' then + require(k).setup(v) + elseif type(v) == 'string' then + require(k)[v]() + elseif v == true then + require(k) end end diff --git a/common/neovim/lua/keymap.lua b/common/neovim/lua/keymap.lua index 0bdc213..a318497 100644 --- a/common/neovim/lua/keymap.lua +++ b/common/neovim/lua/keymap.lua @@ -1,6 +1,4 @@ -local vimdir = os.getenv('XDG_CONFIG_HOME') .. '/nvim' - -for _,keys in ipairs{'jj', 'jJ', 'Jj', 'JJ', 'jk', 'jK', 'Jk', 'JK'} do kmap('i', keys, '', {}) end +for _,keys in ipairs{'jj', 'jJ', 'Jj', 'JJ', 'jk', 'jK', 'Jk', 'JK'} do vim.api.nvim_set_keymap('i', keys, '', {}) end local m = { s = {silent = true}, @@ -9,12 +7,13 @@ local m = { } local keymap = { n = { - ['r'] = {':luafile ' .. vimdir .. '/init.lua:echo \'Reloaded init.lua\'', m.s}, - ['gv'] = {':e ' .. vimdir .. '/init.lua', m.s}, + ['r'] = {':luafile ' .. vim.g.vimdir .. '/init.lua:echo \'Reloaded init.lua\'', m.s}, + ['gv'] = {':e ' .. vim.g.vimdir .. '/init.lua', m.s}, ['w'] = {':bd', m.s}, - ['h'] = {'b#', m.s}, + ['h'] = {':b#', m.s}, ['k'] = {':bnext', m.s}, ['j'] = {':bprevious', m.s}, + ['m'] = {':lua print()', m.s}, ['/'] = {':let @/ = "":', m.s}, [''] = ':qa', [''] = 'Telescope git_files', diff --git a/common/neovim/lua/lsp.lua b/common/neovim/lua/lsp.lua index a29f968..e0c514b 100644 --- a/common/neovim/lua/lsp.lua +++ b/common/neovim/lua/lsp.lua @@ -63,8 +63,7 @@ nvim_lsp.sumneko_lua.setup{ vim.cmd "command! Format execute 'lua vim.lsp.buf.formatting()'" vim.o.completeopt = 'menuone,noinsert' --- Compe setup -require'compe'.setup{ +--[[require'compe'.setup{ enabled=true, autocomplete=true, debug=false, @@ -79,6 +78,7 @@ require'compe'.setup{ documentation=true, source={path=true, nvim_lsp=true}, } +]]-- return { setup=function() diff --git a/common/neovim/lua/options.lua b/common/neovim/lua/options.lua index 3a48dd4..23b77f4 100644 --- a/common/neovim/lua/options.lua +++ b/common/neovim/lua/options.lua @@ -38,10 +38,10 @@ local options = { shortmess = 'filnxToOFIac', history = 1000, undofile = true, - undodir = vimdir .. '/undo', + undodir = vim.g.vimdir .. '/undo', undolevels = 1000, undoreload = 1000, - spellfile = vimdir .. '/spell/en.utf-8.add', + spellfile = vim.g.vimdir .. '/spell/en.utf-8.add', ignorecase = true, smartcase = true, incsearch = true, @@ -59,31 +59,31 @@ local options = { showcmd = false, laststatus = 2, ruler = false, - termguicolors = true, + number = true, } for k,v in pairs(options) do vim.o[k] = v end -vim.api.nvim_exec([[ - hi Search cterm=NONE ctermbg=blue ctermfg=black - hi LineNr ctermbg=0 ctermfg=8 - hi CursorLineNr ctermbg=18 ctermfg=gray - hi IndentGuidesEven ctermbg=18 - hi Normal ctermbg=NONE - hi ActiveBuffer ctermbg=4 ctermfg=0 - hi DirtyBuffer ctermbg=3 ctermfg=0 - hi StatusLine ctermbg=1 ctermfg=7 - hi StatusLineNC ctermbg=2 ctermfg=7 - command! W write - augroup oncommit - au! BufReadPost * - if stridx(&ft, 'commit') >= 0 - exe "startinsert!" - endif - augroup END - augroup slime - au! BufNewFile,BufRead *.slimleex set syntax=slim - augroup END - colorscheme base16-donokai -]], false) +vim.api.nvim_command'colorscheme donokai' + +vim.api.nvim_command[[ +function! SynGroup() + let l:s = synID(line('.'), col('.'), 1) + echo synIDattr(l:s, 'name') . ' -> ' . synIDattr(synIDtrans(l:s), 'name') +endfun +nnoremap :call SynGroup() +]] + +-- vim.api.nvim_command[[ +-- command! W write +-- augroup oncommit +-- au! BufReadPost * +-- if stridx(&ft, 'commit') >= 0 +-- exe "startinsert!" +-- endif +-- augroup END +-- augroup slime +-- au! BufNewFile,BufRead *.slimleex set syntax=slim +-- augroup END +-- ]] diff --git a/common/neovim/lua/plugins.lua b/common/neovim/lua/plugins.lua index f406bfd..48d4414 100644 --- a/common/neovim/lua/plugins.lua +++ b/common/neovim/lua/plugins.lua @@ -1,6 +1,6 @@ local setup = function() - local packer_install_path = "#{fn.stdpath 'data'}/site/pack/packer/start/packer.nvim" - if #vim.fn.glob(packer_install_path) > 0 then + local packer_install_path = vim.fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim' + if #vim.fn.glob(packer_install_path) == 0 then vim.fn.system {'git', 'clone', 'https://github.com/wbthomason/packer.nvim', packer_install_path} vim.api.nvim_command'packadd packer.nvim' end @@ -27,7 +27,7 @@ local setup = function() 'dhruvasagar/vim-prosession', {'nvim-telescope/telescope.nvim', requires = {{'nvim-lua/popup.nvim'}, {'nvim-lua/plenary.nvim'}}}, 'joshdick/onedark.vim', - {'lukas-reineke/indent-blankline.nvim', branch = 'lua'}, + 'lukas-reineke/indent-blankline.nvim', {'lewis6991/gitsigns.nvim', requires = {'nvim-lua/plenary.nvim'}}, 'neovim/nvim-lspconfig', 'hrsh7th/nvim-compe',