Merge branch 'master' into master

This commit is contained in:
Daniel Flanagan 2022-05-10 23:36:15 -05:00
commit d24002133c
122 changed files with 2172 additions and 3790 deletions

4
.gitignore vendored
View file

@ -5,6 +5,4 @@
*.secret
fishd.tmp.*
# TODO: should be unnecessary once color generation is homegrown
/colors/gen/vendor
/colors/gen/tmp
/tags

10
common/bash/rc Normal file
View file

@ -0,0 +1,10 @@
# return if not running interactively
[[ $- != *i* ]] && return
command -v fish >/dev/null 2>&1 && grep fish /etc/shells >/dev/null 2>&1 && {
echo "This user is configured to use 'fish' as its primary shell."
echo " You may want to run 'chsh' and set your shell to $(grep fish /etc/shells | head -n1)'."
echo " Once that's done, simply run 'fish'."
echo " You can also try fish temporarily by running 'fish'. No 'chsh' commitment required."
echo " If you're in bash intentionally for some reason, then ignore this message."
}

7
common/bin/arch-in-docker Executable file
View file

@ -0,0 +1,7 @@
#!/usr/bin/env fish
if test (count $argv) -lt 2
docker run -it --rm archlinux bash
else
docker run -it --rm $argv[1..-2] archlinux $argv[-1]
end

View file

@ -1,26 +1,52 @@
#!/usr/bin/env fish
set host rift
set dir /storage/daniel/backups
set ext .tar.zstd.gpg
# deps: fish, zstd, gpg, ssh
set -q HOST || set HOST (head -n 1 /etc/hostname | tr -d '\n')
# use the backup-host in the ~/.ssh/config as the default backup remote host
set -q BACKUP_REMOTE_HOST || set BACKUP_REMOTE_HOST backup-host
# use a user-specific dir by default to backup to
set -q BACKUP_REMOTE_DIR || set BACKUP_REMOTE_DIR "/storage/"(whoami)"/backups/$HOST"
set BACKUP_FILE_EXT .tar.zstd.gpg
if not set -q argv[1]
echo "No directory provided"
echo "No target file or directory provided"
exit 2
end
if not test -d $argv[1]
echo "Invalid directory given: $argv[1]"
set target $argv[1]
if not test -d $target
echo "Target '$target' is not a directory"
exit 1
end
set fn (date +%Y%m%d_%H%M%S)(basename $argv[1])
pushd (dirname $argv[1])
set remote_path
pushd (dirname $target) >/dev/null
# TODO: progress bar/status?
echo "Streaming PGP encrypted backup of $argv[1] to host rift via ssh at $dir/$fn$ext..."
tar cvf - (basename $argv[1]) 2>/dev/null |
zstd --ultra -T2 -22 |
gpg --encrypt --recipient daniel@lyte.dev |
ssh $host "cat - > $dir/$fn$ext"
popd
set friendly_target (pwd)
set path_friendly_target (pwd | cut -c2- | string replace -a / %)
set backup_file_name (date +%Y-%m-%d_%H-%M-%S)_"$path_friendly_target"
set remote_path "$BACKUP_REMOTE_DIR/$backup_file_name$BACKUP_FILE_EXT"
echo "Streaming PGP encrypted backup of $friendly_target to SSH host $BACKUP_REMOTE_HOST at $remote_path"
ssh $BACKUP_REMOTE_HOST "mkdir -p $BACKUP_REMOTE_DIR" || begin
echo "Failed to SSH to $BACKUP_REMOTE_HOST and create remote dir $BACKUP_REMOTE_DIR"
exit 3
end
# TODO: progress indicator?
tar cf - . |
zstd --ultra -T2 -22 |
gpg --encrypt --recipient daniel@lyte.dev |
ssh $BACKUP_REMOTE_HOST "cat - > $remote_path" || begin
echo "Failed to stream backup"
exit 4
end
popd >/dev/null
# TODO: checksum?
echo "Uploaded to host rift via ssh at $dir/$fn$ext"
echo ' Run `unbackupify '$fn$ext'` to restore!'
echo "Uploaded to host rift via ssh at $remote_path"
echo " Run 'unbackupify \"$backup_file_name$BACKUP_FILE_EXT\"' to restore!"

View file

@ -5,6 +5,7 @@ set -x
umask 077
d="$(date +"%Y-%m-%d_%H-%M-%S")"
fn="$SCROTS_PATH/clipshot_$d.png"
mkdir -p "$SCROTS_PATH"
if is_wayland; then
dim="$(slurp -d)"

0
common/bin/dns-cleaner Executable file
View file

22
common/bin/dns-deleter Executable file
View file

@ -0,0 +1,22 @@
#!/usr/bin/env bash
hostname="${1}"; shift || {
echo "No hostname arg to delete provided."
exit 1
}
API="https://api.netlify.com/api/v1"
TOKEN="$(pass netlify | grep -i token | tr -d ' ' | cut -d ':' -f 2)"
counter=0
curl -sL "$API/dns_zones/lyte_dev/dns_records?access_token=$TOKEN" | \
jq -r '.[] | select(.hostname=="'"$hostname"'") | .hostname+": "+.id' | \
while read -r l; do
counter=$((counter+1))
ID="$(echo $l | awk '{print $2}')"
URL="$API/dns_zones/lyte_dev/dns_records/$ID?access_token=$TOKEN"
curl -vvv -X DELETE -sL "$URL" 2>&1 | grep 'ratelimit-remaining' &
echo "counter: $counter"
jq 'del(.[] | select(.id == "'$ID'"))' /tmp/zone.json > /tmp/zone2.json
mv /tmp/zone2.json /tmp/zone.json
[ $counter -gt 450 ] && break
done
wait

11
common/bin/dns-deleter-matching Executable file
View file

@ -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

View file

@ -0,0 +1,8 @@
#!/usr/bin/env bash
command -v git >/dev/null 2>&1 || { echo "git not installed"; exit 1; }
command -v fish >/dev/null 2>&1 || { echo "fish not installed"; exit 2; }
mkdir -p "$HOME/.config"
git clone https://git.lyte.dev/lytedev/dotfiles.git "$HOME/.config/lytedev-dotfiles"
exec "$HOME/.config/lytedev-dotfiles/common/bin/dotfiles-setup"

View file

@ -8,52 +8,55 @@ export CURDIR
dfp="$(realpath "$(dirname "$0")"/../..)"
detect_os() {
# NixOS
if head /etc/os-release --lines 1 | grep 'NixOS$' >/dev/null 2>&1; then
ln -s "$dfp/os/linux/nix" "$ENV_PATH/os-linux-nix" >/dev/null 2>&1
return
fi
# NixOS
if head /etc/os-release --lines 1 | grep 'NixOS$' > /dev/null 2>&1; then
ln -s "$dfp/os/linux/nix" "$ENV_PATH/os-linux-nix" > /dev/null 2>&1
return
fi
# Arch Linux
if head /etc/os-release --lines 1 | grep 'Arch Linux' >/dev/null 2>&1; then
ln -s "$dfp/os/linux/arch" "$ENV_PATH/os-linux-arch" >/dev/null 2>&1
return
fi
# Arch Linux
if head /etc/os-release --lines 1 | grep 'Arch Linux' > /dev/null 2>&1; then
ln -s "$dfp/os/linux/arch" "$ENV_PATH/os-linux-arch" > /dev/null 2>&1
return
fi
# Pacman-based
if command -v pacman; then
ln -s "$dfp/os/linux/arch" "$ENV_PATH/os-linux-arch" >/dev/null 2>&1
return
fi
# Pacman-based
if command -v pacman; then
ln -s "$dfp/os/linux/arch" "$ENV_PATH/os-linux-arch" > /dev/null 2>&1
return
fi
# TODO: Debian
# TODO: Debian
echo "Failed to auto-detect your OS! Please setup your environments and run this script again."
exit 3
echo "Failed to auto-detect your OS! Please setup your environments and run this script again."
exit 3
}
if command -v git >/dev/null 2>&1; then
if [ -f "$dfp/common/envs" ]; then
# TODO: more shared init stuff?
mkdir -p $ENV_PATH
detect_os
ls -la -R $ENV_PATH/*
find "$ENV_PATH" | while read -r s; do
f="$s/dotfiles-init.d.sh"
if [ -f "$f" ]; then
CURDIR="$s"
. "$f"
fi
done
$dfp/common/bin/dotfiles-setup
else
git clone "https://git.lyte.dev/lytedev/dotfiles.git" "$XDG_CONFIG_HOME/lytedev-dotfiles"
cd "$XDG_CONFIG_HOME/lytedev-dotfiles" || { echo "Could not cd to dotfiles dir"; exit 2; }
. ./common/bin/dotfiles-init
fi
if command -v git > /dev/null 2>&1; then
if [ -f "$dfp/common/envs" ]; then
# TODO: more shared init stuff?
mkdir -p "$ENV_PATH"
detect_os
ls -la -R "$ENV_PATH/*"
find "$ENV_PATH" | while read -r s; do
f="$s/dotfiles-init.d.sh"
if [ -f "$f" ]; then
CURDIR="$s"
. "$f"
fi
done
$dfp/common/bin/dotfiles-setup
else
git clone "https://git.lyte.dev/lytedev/dotfiles.git" "$XDG_CONFIG_HOME/lytedev-dotfiles"
cd "$XDG_CONFIG_HOME/lytedev-dotfiles" || {
echo "Could not cd to dotfiles dir"
exit 2
}
. ./common/bin/dotfiles-init
fi
else
echo "git not installed"
exit 1
echo "git not installed"
exit 1
fi
# TODO: run provision script

View file

@ -1,20 +1,39 @@
#!/usr/bin/env fish
set dfp (realpath (dirname (status -f))/../..)
function files
cat $argv[1] | while read -l l
test -d $l && echo $l
has_command fzf || begin
echo "fzf not installed"
exit 1
end
mkdir -p $ENV_PATH
function filter_existing_directory
while read -l line
test -d $DOTFILES_PATH/$line && echo $line
end
end
files $dfp/common/envs | \
fzf --multi --prompt "Select applicable environments (multi-select w/ TAB): " \
--preview-window="up:50%:noborder" \
--preview="ls -la --color=always {}" | \
string trim | \
read -a -d \n -z lines
for l in $lines
test $l = "" && continue
set ll (string replace -a / - $l)
echo "Linking $ENV_PATH/$ll to $dfp/$l"
ln -s $dfp/$l $ENV_PATH/$ll &>/dev/null
function reject_empty_lines
while read -l line
test $line = "" || echo $line
end
end
function link
while read -l line
set safe_fn (string replace -a / - $line)
echo "Linking $ENV_PATH/$safe_fn to $DOTFILES_PATH/$line"
rm -f $ENV_PATH/$safe_fn
ln -s $DOTFILES_PATH/$line $ENV_PATH/$safe_fn
end
end
cat $DOTFILES_PATH/common/envs |
filter_existing_directory |
fzf --multi \
--prompt "Select applicable environments (multi-select w/ TAB): " \
--preview-window="up:50%:noborder" \
--preview="ls -la --color=always $DOTFILES_PATH/{}" |
string trim |
reject_empty_lines |
link

View file

@ -7,8 +7,9 @@ set dfp (realpath (dirname (status -f))/../..)
set lock_file $HOME/.using-lytedev-dotfiles.lock
if not test -f $lock_file
echo This will delete existing files. Make sure you know what you\'re doing.
read -r -p "Are you sure you want to continue? [y/N] " response
echo "This will delete existing files. Make sure you know what you're doing."
echo 'Are you sure you want to continue? [y/N]'
read response
set response (string lower $response)
if string match $response y
echo "agreed" > "$lock_file"
@ -37,20 +38,25 @@ end
pushd $dfp
l common/tmux/conf $h/.tmux.conf
l common/fish $c/fish
l common/bash/rc $h/.bashrc
l common/neovim $c/nvim
l common/wezterm $c/wezterm
l common/colors/vim $c/nvim/colors/base16-donokai.vim
l common/weechat $h/.weechat
l common/scim/rc $h/.scimrc
l common/scim/lua $h/.scim/lua
l common/nnn $c/nnn
l common/kak $c/kak
l common/helix $c/helix
l common/gpg/agent.conf $h/.gnupg/gpg-agent.conf
l common/htop/rc $c/htop/htoprc
l common/kitty $c/kitty
l common/mutt/rc $c/.muttrc
l common/pgcli $c/pgcli
l common/mutt/rc $h/.muttrc
l common/git/config $h/.gitconfig
l common/elixir/iex.exs $h/.iex.exs
l common/data/user-dirs $c/user-dirs.dirs
l common/blender/userpref.blend $c/blender/2.93/config/userpref.blend
l common/lemonade/config.toml $c/lemonade.toml
popd
for s in $c/lytedev-env/*/dotfiles-setup.d.fish
@ -58,6 +64,6 @@ for s in $c/lytedev-env/*/dotfiles-setup.d.fish
end
# execute the user's shell
set ush (getent passwd $LOGNAME | cut -d: -f7)
set ush (getent passwd (whoami) | cut -d: -f7)
echo "Dotfiles Installed! Don't forget to setup environments!"
exec $ush

View file

@ -1,2 +1,3 @@
#!/usr/bin/env bash
krita "$(ltl "$NICE_HOME/img/scrots/")"
#!/usr/bin/env sh
opener="$(command -v xdg-open 2>&1 >/dev/null && echo "xdg-open" || echo "open")"
exec nohup "$opener" "$NICE_HOME/img/scrots/$(ls -t "$NICE_HOME/img/scrots/" | head -n1)" >/dev/null 2>&1 &

View file

@ -0,0 +1,5 @@
#!/usr/bin/env sh
git branch --merged | \
grep -v "(^\*|master|main|dev)" | \
xargs git branch -dr

View file

@ -0,0 +1,18 @@
#!/usr/bin/env fish
set profile_dirs ~/.mozilla/firefox/*.dev-edition-default
for p in $profile_dirs
mkdir -p $p/chrome
set user_chrome_css_file $p/chrome/userChrome.css
echo '/* Generated by '(status -f)' -- do not edit manually! */' > $user_chrome_css_file
cat $DOTFILES_PATH/common/firefox/userChrome.d.css >> $user_chrome_css_file
echo >> $user_chrome_css_file
for file_part in $ENV_PATH/*/firefox/userChrome.d.css
cat $file_part >> $user_chrome_css_file
echo >> $user_chrome_css_file
end
echo Built $user_chrome_css_file
end
echo Make sure you set 'toolkit.legacyUserProfileCustomizations.stylesheets' to true in about:config

View file

@ -13,5 +13,7 @@ app="$(
grep "\S" | \
fzf
)"
# if no app is selected, just exit
test -z "$app" && exit 1
echo "$app $(date +%s)" >> "$LAUNCHER_HISTORY_FILE"
echo "$app"

View file

@ -1,13 +0,0 @@
#!/usr/bin/env fish
# Echoes the newest file in the specified directory (or current directory if none is given)
set d $argv[1] .
set -l l ""
for f in $d[1]/*
if test -z $l; set l $f; continue; end
if command test $f -nt $l; and test ! -d $f
set l $f
end
end
echo $l

View file

@ -1,13 +0,0 @@
#!/usr/bin/env fish
# Echoes the newest subdirectory in the specified directory (or current directory if none is given)
set d $argv[1] .
set -l l ""
for f in $d[1]/*
if test -z $l; set l $f; continue; end
if command test $f -nt $l; and test -d $f
set l $f
end
end
echo $l

View file

@ -1,2 +1,2 @@
#!/usr/bin/env sh
env FZFP_HEIGHT="100%" floating-term bash -c "fzfp | head -n 1 | wl-copy &"
env FZFP_HEIGHT="100%" floating-term fish -c "fzfp | head -n 1 | clip &"

View file

@ -0,0 +1,6 @@
#!/usr/bin/env fish
set entry $argv[1]
set otp_secret (pass $entry | awk -F': ' '/^otp/{gsub(/\s/,"",$2);print $2}')
set otp_uri "otpauth://totp/totp-secret?secret=$otp_secret&issuer=$entry"
echo $otp_uri | pass otp append $entry

View file

@ -1,12 +0,0 @@
#!/usr/bin/env bash
# TODO: check for pass
key="$1"; shift
args=("$@")
otp="$(set -e; pass "$key" 2>/dev/null | grep -Pi '^otp.*: ?.*$' | cut -d ':' -f 2 | sed 's/ //g')"
otp_status="$?"
[[ $otp_status != 0 ]] && { echo "pass command failed with exit code $otp_status"; exit 1; }
[[ -z $otp ]] && { echo "No OTP secret found for pass entry '$key'"; exit 2; }
simple-otp "$otp"

View file

@ -1,6 +0,0 @@
#!/usr/bin/env fish
# Silent count
count $argv > /dev/null

2
common/bin/tdf Executable file
View file

@ -0,0 +1,2 @@
#!/usr/bin/env fish
tmux-lyte-session dotfiles $DOTFILES_PATH

3
common/bin/tenv Executable file
View file

@ -0,0 +1,3 @@
#!/usr/bin/env sh
d="$(command ls $ENV_PATH | fzf)" && \
tmux-lyte-session "env-$d" "$ENV_PATH/$d"

View file

@ -18,4 +18,8 @@ for s in {0..8}; do # text styles
echo
done
echo -e "Emoji: 😱😍😬🎉"
echo -e "Possible Ligatures:"
echo -r " --> -> == != === ------> ** ++ |> <* := :: |] [| ===>"
echo -r " >= <= =>= ->- >>- <<- <***> =: <. <.> .> ~> ~~> ~~~~>"
echo -r " (* |- -| =!= :> <!-- <==> <--> |} {| >=> <=< ++++ ___"
echo

2
common/bin/tls Executable file
View file

@ -0,0 +1,2 @@
#!/usr/bin/env sh
tmux list-sessions

11
common/bin/tmux-lyte-session Executable file
View file

@ -0,0 +1,11 @@
#!/usr/bin/env fish
set session_name $argv[1]
set dir (set -q argv[2] && echo $argv[2] || pwd)
if set -q TMUX
tmux switch -t $session_name
else
tmux new-session -D -s "$session_name" -c "$dir" $argv[3..-1] || \
tmux switch -d -t "$session_name" -c "$dir"
end

9
common/bin/tmux-session-dir Executable file
View file

@ -0,0 +1,9 @@
#!/usr/bin/env sh
# if inside a session, use the current session
# if not, a session must be specified after the dir
d="${1}"
[ -z "$d" ] && d="#{pane_current_path}"
target_session="${2}"
[ -n "$TMUX" ] && target_session="."
tmux attach-session -t "$target_session" -c "$d"

13
common/bin/tmux-session-preview Executable file
View file

@ -0,0 +1,13 @@
#!/usr/bin/env sh
session_data="$1"
session_id="$(echo "$session_data" | cut -d':' -f1)"
S="$(tmux ls -F'#{session_id} #{session_name}: #{T:tree_mode_format}' | grep ^"$session_id")"
session_info="${S##$s}"
session_name="$(echo "$session_info" | cut -d ':' -f1)"
echo "RAW: $1"
echo "S: $S"
echo "INFO: $session_info"
echo "NAME: $session_name"

View file

@ -7,7 +7,16 @@ t="tmux switch-client -t"
sess="$({ tmux display-message -p -F "$fmt" && tmux list-sessions -F "$fmt"; } \
| awk '!seen[$1]++' \
| column -t -s'|' \
| fzf -q '$' --reverse --prompt 'switch session: ' -1 \
| fzf -q '$' --reverse --prompt 'switch session: ' -1 --preview "tmux-session-preview {}" \
| cut -d':' -f1)"
[ -z "$sess" ] && exit 1
$t $sess
# | while read w; do
# set W (tmux lsw -t"{}" -F'#{window_id}#{T:tree_mode_format}' | grep ^"$w")
# echo " ﬌ ${W##$w}"
# end

View file

@ -1,18 +1,56 @@
#!/usr/bin/env fish
set host rift
set dir /storage/daniel/backups
set ext .tar.zstd.gpg
# deps: fish, zstd, gpg, ssh
if not set -q argv[1]
echo "No backup filename provided"
exit 2
set -q HOST || set HOST (head -n 1 /etc/hostname | tr -d '\n')
# use the backup-host in the ~/.ssh/config as the default backup remote host
set -q BACKUP_REMOTE_HOST || set BACKUP_REMOTE_HOST backup-host
# use a user-specific dir by default to backup to
set -q BACKUP_REMOTE_DIR || set BACKUP_REMOTE_DIR "/storage/"(whoami)"/backups/$HOST"
set BACKUP_FILE_EXT .tar.zstd.gpg
set target $argv[1]
if test $target = '--list-backup-files'
ssh $BACKUP_REMOTE_HOST "command ls -1 $BACKUP_REMOTE_DIR"
exit 0
else if test (count $argv) -lt 1
echo "No remote backup filename provided (use --list-backup-files to show)"
exit 1
end
ssh $BACKUP_REMOTE_HOST "echo 1" &>/dev/null || begin
echo "Cannot ssh to $BACKUP_REMOTE_HOST"
exit 6
end
ssh $BACKUP_REMOTE_HOST "test -d $BACKUP_REMOTE_DIR/$target" || begin
echo "Remote directory $BACKUP_REMOTE_DIR/$target does not exist on $BACKUP_REMOTE_HOST (use --list-backup-files to show)"
exit 5
end
# TODO: autocomplete?
# TODO: checksum?
set fn $argv[1]
ssh $host "cat $dir/$fn$ext" |
gpg --decrypt |
zstd --ultra -T2 -22 -dc |
tar -xvf -
echo "Restored!"
# TODO: progress indicator?
set local_dir (echo $target | awk -F. '{print $1}')
mkdir $local_dir || begin
echo "Local unbackup directory '$local_dir' exists"
exit 2
end
pushd $local_dir >/dev/null
ssh $BACKUP_REMOTE_HOST "cat $BACKUP_REMOTE_DIR/$target" |
gpg --decrypt 2>/dev/null |
zstd --ultra -T2 -22 -dc |
tar -xf - || begin
echo "Failed to stream backup"
exit 4
end
popd >/dev/null
echo "Restored to $local_dir"

View file

@ -5,24 +5,41 @@
HOST="faceless"
f="${1}"
[ "${f}" = "" ] && echo "No file provided. Exiting." >&2 && exit 2
[ ! -e "${f}" ] && echo "File '$f' does not exist. Exiting." >&2 && exit 1
is_dir="$([ ! -e "${f}" ]; echo "$?")"
set -xe
fname="${2:-$(basename "${f}")}"
subdir="${3:-uploads}"
internal_dir="/home/daniel/public-static-files/${subdir}"
url="https://files.lyte.dev/${subdir}/${fname}"
[ "${f}" = "" ] && echo "No file provided. Exiting." >&2 && exit 2
[ ! -f "${f}" ] && echo "File '$f' does not exist. Exiting." >&2 && exit 1
if [ "$(curl -s -o /dev/null -w "%{http_code}" "${url}")" -eq 200 ]; then
echo "ERROR: A file already exists at ${url}"
exit 3
fi
ssh "$HOST" mkdir -p "$(dirname "${internal_dir}/${fname}")"
rsync --progress --no-owner --no-group --chmod=644 --ignore-existing "${f}" "${HOST}:${internal_dir}/${fname}" | tee "${HOME}/.upload.log"
code="$?"
echo "Uploaded to: ${url}"
flags=644
code=""
if [ "$is_dir" = "0" ]; then
ssh "$HOST" mkdir -p "$(dirname "${internal_dir}/${fname}")"
rsync --progress --no-owner --no-group --chmod="$flags" --ignore-existing \
"${f}" "${HOST}:${internal_dir}/${fname}" | tee "${HOME}/.upload.log"
code="$?"
else
ssh "$HOST" mkdir -p "${internal_dir}/${fname}"
flags=755
rsync --recursive --progress --no-owner --no-group --chmod="$flags" \
"${f}" "${HOST}:${internal_dir}" | tee "${HOME}/.upload.log"
code="$?"
fi
if [ "$code" -ne 0 ]; then
printf "ERROR: The file failed to upload - perhaps rsync failed for some reason?\n See \"%s/.upload.log\" for details\n" "$HOME"
else
echo "Uploaded to: ${url}"
fi

Binary file not shown.

View file

@ -1 +0,0 @@
vendor

View file

@ -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

View file

@ -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)}

View file

@ -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"

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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"

View file

@ -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

View file

@ -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
]===]

View file

@ -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"

View file

@ -1,125 +0,0 @@
#!/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

View file

@ -1,62 +0,0 @@
#!/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
# 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
/sbin/clear
else
echo -e "\e[H"
echo -e "\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

View file

@ -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 <sid>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 <sid>hi("Bold", "", "", "", "", "bold", "")
call <sid>hi("Debug", s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("Directory", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("Error", s:gui00, s:gui08, s:cterm00, s:cterm08, "", "")
call <sid>hi("ErrorMsg", s:gui08, s:gui00, s:cterm08, s:cterm00, "", "")
call <sid>hi("Exception", s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("FoldColumn", s:gui0C, s:gui01, s:cterm0C, s:cterm01, "", "")
call <sid>hi("Folded", s:gui03, s:gui01, s:cterm03, s:cterm01, "", "")
call <sid>hi("IncSearch", s:gui01, s:gui09, s:cterm01, s:cterm09, "none", "")
call <sid>hi("Italic", "", "", "", "", "none", "")
call <sid>hi("Macro", s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("MatchParen", s:gui00, s:gui03, s:cterm00, s:cterm03, "", "")
call <sid>hi("ModeMsg", s:gui0B, "", s:cterm0B, "", "", "")
call <sid>hi("MoreMsg", s:gui0B, "", s:cterm0B, "", "", "")
call <sid>hi("Question", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("Search", s:gui03, s:gui0A, s:cterm03, s:cterm0A, "", "")
call <sid>hi("SpecialKey", s:gui03, "", s:cterm03, "", "", "")
call <sid>hi("TooLong", s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("Underlined", s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("Visual", "", s:gui02, "", s:cterm02, "", "")
call <sid>hi("VisualNOS", s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("WarningMsg", s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("WildMenu", s:gui08, s:gui0A, s:cterm08, "", "", "")
call <sid>hi("Title", s:gui0D, "", s:cterm0D, "", "none", "")
call <sid>hi("Conceal", s:gui0D, s:gui00, s:cterm0D, s:cterm00, "", "")
call <sid>hi("Cursor", s:gui00, s:gui05, s:cterm00, s:cterm05, "", "")
call <sid>hi("NonText", s:gui03, "", s:cterm03, "", "", "")
call <sid>hi("Normal", s:gui05, s:gui00, s:cterm05, s:cterm00, "", "")
call <sid>hi("LineNr", s:gui03, s:gui01, s:cterm03, s:cterm01, "", "")
call <sid>hi("SignColumn", s:gui03, s:gui01, s:cterm03, s:cterm01, "", "")
call <sid>hi("StatusLine", s:gui04, s:gui02, s:cterm04, s:cterm02, "none", "")
call <sid>hi("StatusLineNC", s:gui03, s:gui01, s:cterm03, s:cterm01, "none", "")
call <sid>hi("VertSplit", s:gui02, s:gui02, s:cterm02, s:cterm02, "none", "")
call <sid>hi("ColorColumn", "", s:gui01, "", s:cterm01, "none", "")
call <sid>hi("CursorColumn", "", s:gui01, "", s:cterm01, "none", "")
call <sid>hi("CursorLine", "", s:gui01, "", s:cterm01, "none", "")
call <sid>hi("CursorLineNr", s:gui03, s:gui01, s:cterm03, s:cterm01, "", "")
call <sid>hi("PMenu", s:gui04, s:gui01, s:cterm04, s:cterm01, "none", "")
call <sid>hi("PMenuSel", s:gui01, s:gui04, s:cterm01, s:cterm04, "", "")
call <sid>hi("TabLine", s:gui03, s:gui01, s:cterm03, s:cterm01, "none", "")
call <sid>hi("TabLineFill", s:gui03, s:gui01, s:cterm03, s:cterm01, "none", "")
call <sid>hi("TabLineSel", s:gui0B, s:gui01, s:cterm0B, s:cterm01, "none", "")
" Standard syntax highlighting
call <sid>hi("Boolean", s:gui09, "", s:cterm09, "", "", "")
call <sid>hi("Character", s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("Comment", s:gui03, "", s:cterm03, "", "", "")
call <sid>hi("Conditional", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("Constant", s:gui09, "", s:cterm09, "", "", "")
call <sid>hi("Define", s:gui0E, "", s:cterm0E, "", "none", "")
call <sid>hi("Delimiter", s:gui0F, "", s:cterm0F, "", "", "")
call <sid>hi("Float", s:gui09, "", s:cterm09, "", "", "")
call <sid>hi("Function", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("Identifier", s:gui08, "", s:cterm08, "", "none", "")
call <sid>hi("Include", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("Keyword", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("Label", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("Number", s:gui09, "", s:cterm09, "", "", "")
call <sid>hi("Operator", s:gui05, "", s:cterm05, "", "none", "")
call <sid>hi("PreProc", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("Repeat", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("Special", s:gui0C, "", s:cterm0C, "", "", "")
call <sid>hi("SpecialChar", s:gui0F, "", s:cterm0F, "", "", "")
call <sid>hi("Statement", s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("StorageClass", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("String", s:gui0B, "", s:cterm0B, "", "", "")
call <sid>hi("Structure", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("Tag", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("Todo", s:gui0A, s:gui01, s:cterm0A, s:cterm01, "", "")
call <sid>hi("Type", s:gui0A, "", s:cterm0A, "", "none", "")
call <sid>hi("Typedef", s:gui0A, "", s:cterm0A, "", "", "")
" C highlighting
call <sid>hi("cOperator", s:gui0C, "", s:cterm0C, "", "", "")
call <sid>hi("cPreCondit", s:gui0E, "", s:cterm0E, "", "", "")
" C# highlighting
call <sid>hi("csClass", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("csAttribute", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("csModifier", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("csType", s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("csUnspecifiedStatement", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("csContextualStatement", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("csNewDecleration", s:gui08, "", s:cterm08, "", "", "")
" CSS highlighting
call <sid>hi("cssBraces", s:gui05, "", s:cterm05, "", "", "")
call <sid>hi("cssClassName", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("cssColor", s:gui0C, "", s:cterm0C, "", "", "")
" Diff highlighting
call <sid>hi("DiffAdd", s:gui0B, s:gui01, s:cterm0B, s:cterm01, "", "")
call <sid>hi("DiffChange", s:gui03, s:gui01, s:cterm03, s:cterm01, "", "")
call <sid>hi("DiffDelete", s:gui08, s:gui01, s:cterm08, s:cterm01, "", "")
call <sid>hi("DiffText", s:gui0D, s:gui01, s:cterm0D, s:cterm01, "", "")
call <sid>hi("DiffAdded", s:gui0B, s:gui00, s:cterm0B, s:cterm00, "", "")
call <sid>hi("DiffFile", s:gui08, s:gui00, s:cterm08, s:cterm00, "", "")
call <sid>hi("DiffNewFile", s:gui0B, s:gui00, s:cterm0B, s:cterm00, "", "")
call <sid>hi("DiffLine", s:gui0D, s:gui00, s:cterm0D, s:cterm00, "", "")
call <sid>hi("DiffRemoved", s:gui08, s:gui00, s:cterm08, s:cterm00, "", "")
" Git highlighting
call <sid>hi("gitCommitOverflow", s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("gitCommitSummary", s:gui0B, "", s:cterm0B, "", "", "")
" GitGutter highlighting
call <sid>hi("GitGutterAdd", s:gui0B, s:gui01, s:cterm0B, s:cterm01, "", "")
call <sid>hi("GitGutterChange", s:gui0D, s:gui01, s:cterm0D, s:cterm01, "", "")
call <sid>hi("GitGutterDelete", s:gui08, s:gui01, s:cterm08, s:cterm01, "", "")
call <sid>hi("GitGutterChangeDelete", s:gui0E, s:gui01, s:cterm0E, s:cterm01, "", "")
" HTML highlighting
call <sid>hi("htmlBold", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("htmlItalic", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("htmlEndTag", s:gui05, "", s:cterm05, "", "", "")
call <sid>hi("htmlTag", s:gui05, "", s:cterm05, "", "", "")
" JavaScript highlighting
call <sid>hi("javaScript", s:gui05, "", s:cterm05, "", "", "")
call <sid>hi("javaScriptBraces", s:gui05, "", s:cterm05, "", "", "")
call <sid>hi("javaScriptNumber", s:gui09, "", s:cterm09, "", "", "")
" Markdown highlighting
call <sid>hi("markdownCode", s:gui0B, "", s:cterm0B, "", "", "")
call <sid>hi("markdownError", s:gui05, s:gui00, s:cterm05, s:cterm00, "", "")
call <sid>hi("markdownCodeBlock", s:gui0B, "", s:cterm0B, "", "", "")
call <sid>hi("markdownHeadingDelimiter", s:gui0D, "", s:cterm0D, "", "", "")
" NERDTree highlighting
call <sid>hi("NERDTreeDirSlash", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("NERDTreeExecFile", s:gui05, "", s:cterm05, "", "", "")
" PHP highlighting
call <sid>hi("phpMemberSelector", s:gui05, "", s:cterm05, "", "", "")
call <sid>hi("phpComparison", s:gui05, "", s:cterm05, "", "", "")
call <sid>hi("phpParent", s:gui05, "", s:cterm05, "", "", "")
" Python highlighting
call <sid>hi("pythonOperator", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("pythonRepeat", s:gui0E, "", s:cterm0E, "", "", "")
" Ruby highlighting
call <sid>hi("rubyAttribute", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("rubyConstant", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("rubyInterpolation", s:gui0B, "", s:cterm0B, "", "", "")
call <sid>hi("rubyInterpolationDelimiter", s:gui0F, "", s:cterm0F, "", "", "")
call <sid>hi("rubyRegexp", s:gui0C, "", s:cterm0C, "", "", "")
call <sid>hi("rubySymbol", s:gui0B, "", s:cterm0B, "", "", "")
call <sid>hi("rubyStringDelimiter", s:gui0B, "", s:cterm0B, "", "", "")
" SASS highlighting
call <sid>hi("sassidChar", s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("sassClassChar", s:gui09, "", s:cterm09, "", "", "")
call <sid>hi("sassInclude", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("sassMixing", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("sassMixinName", s:gui0D, "", s:cterm0D, "", "", "")
" Signify highlighting
call <sid>hi("SignifySignAdd", s:gui0B, s:gui01, s:cterm0B, s:cterm01, "", "")
call <sid>hi("SignifySignChange", s:gui0D, s:gui01, s:cterm0D, s:cterm01, "", "")
call <sid>hi("SignifySignDelete", s:gui08, s:gui01, s:cterm08, s:cterm01, "", "")
" Spelling highlighting
call <sid>hi("SpellBad", "", s:gui00, "", s:cterm00, "undercurl", s:gui08)
call <sid>hi("SpellLocal", "", s:gui00, "", s:cterm00, "undercurl", s:gui0C)
call <sid>hi("SpellCap", "", s:gui00, "", s:cterm00, "undercurl", s:gui0D)
call <sid>hi("SpellRare", "", s:gui00, "", s:cterm00, "undercurl", s:gui0E)
" Remove functions
delf <sid>hi
delf <sid>gui
delf <sid>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

View file

@ -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

View file

@ -21,3 +21,5 @@ host/laptop/divvy-macbook
host/laptop/postmates-macbook
host/laptop/uber-macbook
host/laptop/val-macbook
host/layer/personal
host/layer/nginx-user-public

View file

@ -0,0 +1,3 @@
#webrtcIndiator {
display: none;
}

View file

@ -1 +1,5 @@
fish_*
completions
conf.d
functions

View file

@ -1,111 +0,0 @@
#!/usr/bin/env fish
alias ls 'exa --group-directories-first'
alias tree 'ls --tree --level=3'
alias lA 'ls -a'
alias ll 'ls -l'
alias la 'll -a'
alias lt 'll -s modified'
alias lT 'lt -r'
alias lc 'lt -s accessed'
alias lC 'lc -r'
set -gx CDPATH $CDPATH . $NICE_HOME
function d -w cd --description "Quickly jump to NICE_HOME (or given relative or absolute path) and list files."
if scount $argv
cd $argv || exit 1
else
cd $NICE_HOME || exit 1
end
la
end
function c -w cd --description "Quickly jump to a subdirectory of NICE_HOME (or just to NICE_HOME if none given)"
if scount $argv
cd $NICE_HOME && d $argv || exit 1
else
d $NICE_HOME
end
end
alias cd.. "d .."
alias cdd "d $DOTFILES_PATH"
alias cde "d $XDG_CONFIG_HOME/lytedev-env"
alias cdc "d $XDG_CONFIG_HOME"
alias cdn "d $NOTES_PATH"
alias cdl "d $XDG_DOWNLOAD_DIR"
alias cdg "d $XDG_GAMES_DIR"
alias .. "d .."
alias ... "d ../.."
alias .... "d ../../.."
alias ..... "d ../../../.."
alias ...... "d ../../../../.."
alias ....... "d ../../../../../.."
alias ........ "d ../../../../../../.."
alias ......... "d ../../../../../../../.."
function r --wraps nnn --description 'Run nnn with support for jump-to-directory-on-exit via ^G'
# TODO: this would break with multiple nnn instances, right?
# probably need to mktemp instead
set NNN_TMPFILE "$XDG_CONFIG_HOME/nnn/.lastd"
nnn -P p $argv
test -e $NNN_TMPFILE && source $NNN_TMPFILE && rm $NNN_TMPFILE
end
alias l r
alias t "tmux"
alias rcp 'rsync -r -ah --progress'
alias cat bat
function g -w git
if scount $argv; git $argv
else; git status; end
end
alias dlf "docker logs --tail=500 -f"
alias dclf "docker-compose logs --tail=500 -f"
alias ctop "docker run --rm -ti -v /var/run/docker.sock:/var/run/docker.sock quay.io/vektorlab/ctop:latest"
function chat
set -l pass (pass config/weechat-passphrase | head -n 1)
env WEECHAT_PASSPHRASE=$pass weechat
end
function rgl; rg --color always $argv | less -r; end
alias k "kubectl"
alias kg "k get"
alias rg "rg --text"
alias grep "rg"
alias gr "rg"
alias vim "$EDITOR"
alias vi "$EDITOR"
alias v "$EDITOR"
alias e "$EDITOR"
alias se "sudo -E $EDITOR"
alias svim "se"
alias vltl "$EDITOR (ltl)"
alias cdltl "cd (ltld)"
function pp; while not ping -n 1 -t 5 8.8.8.8; sleep 1; end; end
alias p "ping 8.8.8.8"
alias C "clear; set -q TMUX && tmux clear-history || true"
alias sctl "sudo systemctl"
alias sctlu "systemctl --user"
alias bt "sctl start bluetooth && sudo bluetoothctl"
alias btctl "bt"
alias resrc "source $XDG_CONFIG_HOME/fish/config.fish; fish_user_key_bindings"
alias sc "sc-im"
alias scs "sc-im $NOTES_PATH/_scratch.sc"
alias disks "lsblk && df -h"
alias dd "dd status=progress"
alias wifi "sudo iwctl"
alias year 'cal (date +%Y)'
alias mount 'sudo -E mount'
alias pa pulsemixer
alias mail neomutt
alias wje work-journal-entry

11
common/fish/colors.fish Executable file → Normal file
View file

@ -1,13 +1,3 @@
#!/usr/bin/env fish
# TODO: once, I could set backgrounds
# unused since we handle it ourselves in fish_prompt
set -U fish_color_cwd magenta
set -U fish_color_cwd_root red
set -U fish_color_host normal
set -U fish_color_user blue
set -U fish_color_normal normal # default color
set -U fish_color_command white # base command being run (>ls< -la)
set -U fish_color_param white # command's parameters
@ -25,7 +15,6 @@ set -U fish_color_selection blue # vi mode visual selection (only fg)
set -U fish_color_valid_path yellow # if an argument is a valid path (only -u?)
set -U fish_color_comment 666 brblack # comments like this one!
# pager shown when completing
set -U fish_pager_color_completion white # main color for pager
set -U fish_pager_color_description magenta # color for meta description
set -U fish_pager_color_prefix blue # the string being completed

View file

@ -1,7 +0,0 @@
complete -c fisher -x -l help -d "print usage help"
complete -c fisher -x -l version -d "print fisher version"
complete -c fisher -x -n "__fish_use_subcommand" -a install -d "install plugins"
complete -c fisher -x -n "__fish_use_subcommand" -a update -d "update installed plugins"
complete -c fisher -x -n "__fish_use_subcommand" -a remove -d "remove installed plugins"
complete -c fisher -x -n "__fish_use_subcommand" -a list -d "list installed plugins matching <regex>"
complete -c fisher -x -n "__fish_seen_subcommand_from update remove" -a "(fisher list)"

File diff suppressed because it is too large Load diff

View file

@ -1,11 +1,4 @@
#!/usr/bin/env fish
set -Ux XDG_CONFIG_HOME $HOME/.config
set -Ux DOTFILES_PATH $XDG_CONFIG_HOME/lytedev-dotfiles
set -Ux ENV_PATH $XDG_CONFIG_HOME/lytedev-env
set -Ux FISH_PATH $XDG_CONFIG_HOME/fish
source $FISH_PATH/paths.fish
source (dirname (status --current-filename))/paths.fish
for s in $ENV_PATH/*/config.d.fish
source $s (dirname $s)
@ -13,43 +6,40 @@ end
status --is-interactive || exit
$DOTFILES_PATH/common/colors/vconsole
for f in key-bindings colors prompt aliases
for f in vars colors prompt functions key-bindings
source $FISH_PATH/$f.fish
end
has_command nnn && source $DOTFILES_PATH/common/nnn/config.fish
set -Ux _JAVA_AWT_WM_NONREPARENTING 1
set -Ux TERMINAL kitty
set -Ux BROWSER firefox-developer-edition
set -Ux ERL_AFLAGS "-kernel shell_history enabled -kernel shell_history_file_bytes 1024000" # iex history
set -Ux LESS "-r"
set -Ux LS_COLORS 'ow=01;36;40' # more sane ls colors
set -Ux EXA_COLORS '*=0'
set -Ux EDITOR nvim
set -Ux VISUAL nvim
set -Ux PAGER less
set -Ux MANPAGER 'env MANWIDTH="" nvim --cmd "let g:prosession_on_startup=0" +Man!'
function fish_greeting;
set_color -b black brblack
printf "%s@%s %s\n" $USER (hostname) (date)
printf "%6d processes running\n" (ps -aux | wc -l)
has_command free && printf "%6sGB memory available\n" (free -g | grep '^Mem:' | tr -s ' ' | cut -d ' ' -f7)
test -f /proc/sys/kernel/pty/nr && printf "%6d PTYs open\n" (cat /proc/sys/kernel/pty/nr)
end
# assume the user uses "$HOME" to just store their mess of dotfiles and other
# nonsense that clutters it up and that they have a preferred starting
# directory where they keep the stuff they actually care about
# we only do this if the user is opening a shell at $HOME
if test $PWD = $HOME; or test $PWD = $NICE_HOME;
cd $NICE_HOME || cd
end
if test -f $HOME/.asdf/asdf.fish
if has_command brew && test -f (brew --prefix asdf)/lib/asdf.fish
set -Ux ASDF_DIR (brew --prefix asdf)
source (brew --prefix asdf)/lib/asdf.fish
else if test -f $HOME/.asdf/asdf.fish
source $HOME/.asdf/asdf.fish
else if test -f /opt/asdf-vm/asdf.fish
source /opt/asdf-vm/asdf.fish
end
if test -f /usr/share/password-store/extensions/otp.bash
source $FISH_PATH/pass-otp-completions.fish
end
if test -f /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
set nix_profiles /nix/var/nix/profiles/default $HOME/.nix-profile
set --export --universal NIX_PROFILES "$nix_profiles"
if set -q NIX_SSL_CERT_FILE
:
elif test -e /etc/ssl/certs/ca-certificates.crt
set --export --universal NIX_SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
else
for p in (string split $NIX_PROFILES)
test -e $p/etc/ssl/certs/ca-bundle.crt && \
set --export --universal NIX_SSL_CERT_FILE=$p/etc/ssl/certs/ca-bundle.crt
end
end
set --prepend --export --global fish_user_paths $HOME/.nix-profile/bin /nix/var/nix/profiles/default/bin
end
test $PWD = $HOME && begin; cd $NICE_HOME || cd; end

217
common/fish/functions.fish Normal file
View file

@ -0,0 +1,217 @@
function has_command --wraps=command --description "Exits non-zero if the given command cannot be found"
command --quiet --search $argv[1]
end
if has_command exa
alias ls 'exa --group-directories-first'
alias l ls
alias tree 'ls --tree --level=3'
alias lt 'll --sort=modified'
alias lat 'la --sort=modified'
alias lc 'lt --sort=accessed'
alias lT 'lt --reverse'
alias lC 'lc --reverse'
end
alias lA 'ls --all'
alias ll 'ls -l'
alias la 'll --all'
function scount --wraps=count --description "Silent count exits with a non-zero status if no arguments given to count"
count $argv > /dev/null
end
function d --wraps=cd --description "Quickly jump to NICE_HOME (or given relative or absolute path) and list files."
if scount $argv
cd $argv
else
cd $NICE_HOME
end
la
end
function c --wraps=cd --description "Quickly jump to a subdirectory of NICE_HOME (or just to NICE_HOME if none given)"
if scount $argv
cd $NICE_HOME && d $argv
else
d $NICE_HOME
end
end
alias cd.. "d .."
alias cdd "d $DOTFILES_PATH"
alias cde "d $XDG_CONFIG_HOME/lytedev-env"
alias cdc "d $XDG_CONFIG_HOME"
alias cdn "d $NOTES_PATH"
alias cdl "d $XDG_DOWNLOAD_DIR"
alias cdg "d $XDG_GAMES_DIR"
alias .. "d .."
alias ... "d ../.."
alias .... "d ../../.."
alias ..... "d ../../../.."
alias ...... "d ../../../../.."
alias ....... "d ../../../../../.."
alias ........ "d ../../../../../../.."
alias ......... "d ../../../../../../../.."
if has_command nnn
function r --wraps nnn --description 'Run nnn with support for jump-to-directory-on-exit via ^G'
# TODO: this would break with multiple nnn instances, right?
# probably need to mktemp instead
set -u NNN_TMPFILE (mktemp)
export NNN_TMPFILE
nnn -P p $argv
test -e $NNN_TMPFILE && source $NNN_TMPFILE && cp $NNN_TMPFILE ~/.nnn-last-tmpfile && rm $NNN_TMPFILE
end
alias l r
end
has_command tmux && alias t "tmux"
has_command rsync && alias rcp 'rsync -r -ah --progress'
has_command bat && alias cat bat
if has_command git
function g -w git
if scount $argv; git $argv
else; git status; end
end
end
if has_command docker
alias dlf "docker logs --tail=500 -f"
alias ctop "docker run --rm -ti -v /var/run/docker.sock:/var/run/docker.sock quay.io/vektorlab/ctop:latest"
end
if has_command docker-compose
alias dclf "docker-compose logs --tail=500 -f"
end
if has_command weechat
function chat
set -l pass (pass config/weechat-passphrase | head -n 1)
env WEECHAT_PASSPHRASE=$pass weechat
end
end
if has_command rg
function rgl; rg --color always $argv | less -r; end
alias rg "rg --text"
alias grep "rg"
alias gr "rg"
end
if has_command kubectl
alias k "kubectl"
alias kg "k get"
end
alias vim $EDITOR
alias vi $EDITOR
alias v $EDITOR
alias e $EDITOR
alias sv "sudo -E $EDITOR"
alias se sv
alias svim sv
function ltl --wraps=ls --description "Echoes the name of the file most recently modified either in the current directory or in the given path"
set d $argv[1] .
set -l l ""
for f in $d[1]/*
if test -z $l; set l $f; continue; end
if command test $f -nt $l; and test ! -d $f
set l $f
end
end
echo $l
end
function ltld --wraps=ls --description "Echoes the name of the directory most recently modified either in the current directory or in the given path"
set d $argv[1] .
set -l l ""
for f in $d[1]/*
if test -z $l; set l $f; continue; end
if command test $f -nt $l; and test -d $f
set l $f
end
end
echo $l
end
alias vltl "$EDITOR (ltl)"
alias cdltl "cd (ltld)"
function p
set ip 8.8.8.8
set -q argv[1] && set ip $argv[1]
ping $ip $argv[2..]
end
function pp --description "Keeps trying to ping 8.8.8.8 forever"
while not ping -n 1 -w 5 8.8.8.8
sleep 1
end
end
alias C "clear; set -q TMUX && begin; has_command tmux && tmux clear-history; end || true"
if has_command systemctl
alias sctl "sudo systemctl"
alias sctlu "systemctl --user"
alias bt "sctl start bluetooth && sudo bluetoothctl"
alias btctl "bt"
end
alias resrc "source $XDG_CONFIG_HOME/fish/config.fish; fish_user_key_bindings"
has_command sc && alias scs "sc $NOTES_PATH/_scratch.sc"
alias dd "dd status=progress"
alias year 'cal (date +%Y)'
alias mount 'sudo -E mount'
alias umount 'sudo -E umount'
has_command xdg-open && alias open xdg-open
has_command docker && begin
alias dc "docker compose"
alias dk "docker"
end
function fish_preexec
test -n $TMUX && begin
set envlist (tmux show-environment)
for var in DISPLAY WAYLAND_DISPLAY
set -gx $var (echo $envlist | rg '^'$var'=(.*)$' -r '$1')
end
end
end
# source:
# https://github.com/ivakyb/fish_ssh_agent/blob/master/functions/fish_ssh_agent.fish
function __ssh_agent_is_started -d "check if ssh agent is already started"
if begin; test -f $SSH_ENV; and test -z "$SSH_AGENT_PID"; end
source $SSH_ENV > /dev/null
end
if test -z "$SSH_AGENT_PID"
return 1
end
ps -ef | grep $SSH_AGENT_PID | grep -v grep | grep -q ssh-agent
#pgrep ssh-agent
return $status
end
function __ssh_agent_start -d "start a new ssh agent"
ssh-agent -c | sed 's/^echo/#echo/' > $SSH_ENV
chmod 600 $SSH_ENV
source $SSH_ENV > /dev/null
true # suppress errors from setenv, i.e. set -gx
end
function fish_ssh_agent --description "Start ssh-agent if not started yet, or uses already started ssh-agent."
if test -z "$SSH_ENV"
set -xg SSH_ENV $HOME/.ssh/environment
end
if not __ssh_agent_is_started
__ssh_agent_start
end
end

35
common/fish/key-bindings.fish Executable file → Normal file
View file

@ -1,11 +1,7 @@
#!/usr/bin/env fish
function fish_user_key_bindings
# has_command fd && set -Ux FZF_DEFAULT_COMMAND 'fd --type f --hidden --follow --exclude .git'
test -f $HOME/.fzf/shell/key-bindings.fish && source $HOME/.fzf/shell/key-bindings.fish
fzf_key_bindings
type -q fzf_key_bindings && fzf_key_bindings
fish_vi_key_bindings insert --no-erase
set vi_esc "if commandline -P; commandline -f cancel; else; set fish_bind_mode default; commandline -f backward-char force-repaint; end"
@ -23,36 +19,9 @@ function fish_user_key_bindings
bind -M insert \cn down-or-search
bind -M insert \ce end-of-line
bind -M insert \ca beginning-of-line
bind -M insert \cw forward-word
bind -M insert \cv edit_command_buffer
bind -M default \cv edit_command_buffer
bind -M insert \ee false
bind -M insert \ev false
bind -M default \ee false
bind -M default \ev false
bind -M insert --erase \ct
bind -M default --erase \ct
bind --erase \c\t
bind --erase \cs
bind --erase btab
bind --erase --preset -M visual -k btab
bind --erase --preset -M insert -k btab
bind --erase --preset -M default -k btab
bind --erase --preset -k btab
bind --erase -M visual -k btab
bind --erase -M insert -k btab
bind --erase -M default -k btab
bind --erase -k btab
bind --erase \cs
bind --erase -M insert \cs
bind --erase -M default \cs
bind -M insert \cs 'tmux info && tmux attach -t default || tmux new-session -s default'
bind -M default \cs 'tmux info && tmux attach -t default || tmux new-session -s default'
bind -M insert \ct 'tmux info && tmux new-window -t default || tmux new-session -s default'
bind -M default \ct 'tmux info && tmux new-window -t default || tmux new-session -s default'
bind -M insert \cs tmuxswitcher
end

View file

@ -0,0 +1,4 @@
#!/usr/bin/env fish
complete -c pass -f -n '__fish_pass_needs_command' -a otp -d 'Command: show TOTP code'
complete -c pass -f -n '__fish_pass_uses_command otp' -s c -l clip -d 'Put TOTP code in clipboard'
complete -c pass -f -n '__fish_pass_uses_command otp' -a "(__fish_pass_print_entries)"

97
common/fish/paths.fish Executable file → Normal file
View file

@ -1,59 +1,74 @@
#!/usr/bin/env fish
set --export --universal XDG_CONFIG_HOME $HOME/.config
set --export --universal XDG_CACHE_HOME $HOME/.cache
set --export --universal XDG_DATA_HOME $HOME/.local/share
set --export --universal XDG_STATE_HOME $HOME/.local/state
set -Ux GOPATH $HOME/.go
set --export --universal DOTFILES_PATH $XDG_CONFIG_HOME/lytedev-dotfiles
set --export --universal ENV_PATH $XDG_CONFIG_HOME/lytedev-env
set --export --universal FISH_PATH $XDG_CONFIG_HOME/fish
set -U fish_user_paths \
$HOME/.go \
$GOPATH/bin \
if not set --query NICE_HOME
# default NICE_HOME to HOME
set --export --universal NICE_HOME $HOME
# if HOME ends with a dir called .home, assume that NICE_HOME is HOME's parent dir
test (basename $HOME) = .home && set --export --universal NICE_HOME (realpath $HOME/..)
end
# reset paths on shell start
set --erase --global fish_user_paths
# add NICE_HOME to CDPATH (see `man 1 cd`)
set --erase CDPATH
set --export --global CDPATH . $NICE_HOME
set --export --universal GOPATH $HOME/.go
set --export --universal GOBIN $GOPATH/bin
set paths_candidates \
$DOTFILES_PATH/common/bin \
$HOME/.bin \
$HOME/.cargo/bin \
$HOME/.nimble/bin \
$HOME/.local/bin \
$HOME/.deno/bin \
$HOME/.yarn/bin \
$HOME/.nimble/bin \
$HOME/.cargo/bin \
$HOME/.go \
$GOPATH/bin \
$HOME/.netlify/helper/bin
for d in $ENV_PATH/*/bin
test -d $d && set -Ua fish_user_paths $d
# add candidate paths to PATH if they exist
for d in $paths_candidates $ENV_PATH/*/bin
test -d $d && set --append --export --global fish_user_paths $d
end
test -d $HOME/.local/bin && set -Ua fish_user_paths $HOME/.local/bin
test -d $HOME/.bin && set -Ua fish_user_paths $HOME/.local/bin
command --search --quiet python && \
set --append --export --global fish_user_paths (python -m site --user-base)/bin
has_command python && set -Ua fish_user_paths (python -m site --user-base)/bin
has_command ruby && set -Ua fish_user_paths (ruby -e 'print Gem.user_dir')/bin
command --search --quiet ruby && \
set --append --export --global fish_user_paths (ruby -e 'print Gem.user_dir')/bin
if set -q NICE_HOME
else
set -Ux NICE_HOME $HOME
test (basename $HOME) = .home && set -Ux NICE_HOME (realpath $HOME/..)
test -f $HOME/.nice_home && set -Ux NICE_HOME (cat $HOME/.nice_home)
test -f $ENV_PATH/.nice_home && set -Ux NICE_HOME (cat $ENV_PATH/.nice_home)
end
for p in $NICE_HOME $HOME $ENV_PATH
test -f $p/.nice_home && set -Ux NICE_HOME (cat $p/.nice_home)
end
set --export --universal NOTES_PATH $NICE_HOME/doc/notes
set --export --universal SCROTS_PATH $NICE_HOME/img/scrots
set --export --universal USER_LOGS_PATH $NICE_HOME/doc/logs
set -Ux NOTES_PATH $NICE_HOME/doc/notes
set -Ux SCROTS_PATH $NICE_HOME/img/scrots
set -Ux USER_LOGS_PATH $NICE_HOME/doc/logs
set --export --universal XDG_DESKTOP_DIR $HOME/desktop
set --export --universal XDG_PUBLICSHARE_DIR $HOME/public
set --export --universal XDG_TEMPLATES_DIR $HOME/templates
set -Ux XDG_DESKTOP_DIR $HOME/desktop
set -Ux XDG_PUBLICSHARE_DIR $HOME/public
set -Ux XDG_TEMPLATES_DIR $HOME/templates
set --export --universal XDG_DOCUMENTS_DIR $NICE_HOME/doc
set --export --universal XDG_DOWNLOAD_DIR $NICE_HOME/dl
set --export --universal XDG_MUSIC_DIR $NICE_HOME/music
set --export --universal XDG_PICTURES_DIR $NICE_HOME/img
set --export --universal XDG_VIDEOS_DIR $NICE_HOME/video
set --export --universal XDG_GAMES_DIR $NICE_HOME/games
set -Ux XDG_DOCUMENTS_DIR $NICE_HOME/doc
set -Ux XDG_DOWNLOAD_DIR $NICE_HOME/dl
set -Ux XDG_MUSIC_DIR $NICE_HOME/music
set -Ux XDG_PICTURES_DIR $NICE_HOME/img
set -Ux XDG_VIDEOS_DIR $NICE_HOME/video
set -Ux XDG_GAMES_DIR $NICE_HOME/games
set -Ux TMUX_PLUGIN_MANAGER_PATH $XDG_CONFIG_HOME/tmux/plugins/
set -Ux NOTES_PATH $XDG_DOCUMENTS_DIR/notes
set -Ux USER_LOGS_PATH $XDG_DOCUMENTS_DIR/logs
set -Ux SCROTS_PATH $XDG_PICTURES_DIR/scrots
set --export --universal NOTES_PATH $XDG_DOCUMENTS_DIR/notes
set --export --universal USER_LOGS_PATH $XDG_DOCUMENTS_DIR/logs
set --export --universal SCROTS_PATH $XDG_PICTURES_DIR/scrots
if test -n "$NIX_PATH"
set NIX_PATH :
end
set -Ux NIX_PATH $HOME/.nix-defexpr/channels:$NIX_PATH
test -d $HOME/.nix-defexpr/channels && \
set --export --universal NIX_PATH $HOME/.nix-defexpr/channels:$NIX_PATH

17
common/fish/prompt.fish Executable file → Normal file
View file

@ -1,17 +1,18 @@
#!/usr/bin/env fish
set MAX_PATH_PIECE_CHARS 3
# TODO: if root, background instead?
function get_hostname
has_command hostname && hostname || cat /etc/hostname
end
set MAX_PATH_PIECE_CHARS $BASH_PROMPT_MAX_PATH_PIECE_CHARS 3
function fish_greeting
set_color -b black brblack
printf "%s@%s %s\n" $USER (get_hostname) (date)
end
# prompt rendering functions
function preprocess_pwd
test (pwd) = / && echo "/" && return 1
test (pwd) = $NICE_HOME && echo "~" && return 0
# with ellipsis
# echo "$(<<< "$p" cut -c2- | awk '{split($0,p,"/");for(k in p){if(k==length(p)){printf "/%s",p[k]}else{if(length(p[k])>'"
# $((MAX_PATH_PIECE_CHARS+1))"'){printf "/%.'"$((MAX_PATH_PIECE_CHARS))"'s…",p[k]}else{printf "/%s",p[k]}}}}')"
# without ellipsis
# TODO: fix for macOS
echo (pwd) | cut -c2- | \
awk '{split($0,p,"/");for(k in p){if(k==length(p)){printf "/%s",p[k]}else{printf "/%.'$MAX_PATH_PIECE_CHARS[1]'s",p[k]}}}'
end

30
common/fish/vars.fish Normal file
View file

@ -0,0 +1,30 @@
# sane ls colors
set --export --universal LS_COLORS 'ow=01;36;40'
set --export --universal EXA_COLORS '*=0'
# iex history
set --export --universal ERL_AFLAGS "-kernel shell_history enabled -kernel shell_history_file_bytes 1024000"
set --export --universal TERMINAL kitty
set --export --universal TERMINAL_ARGS '--single-instance'
set --export --universal BROWSER firefox-developer-edition
set --export --universal PAGER less
set --export --universal LESS "-r"
set --export --universal MANPAGER 'env MANWIDTH="" nvim --cmd "let g:prosession_on_startup=0" +Man!'
if command --search --quiet nvim
set --export --universal EDITOR nvim
set --export --universal VISUAL nvim
else if command --search --quiet vim
set --export --universal EDITOR vim
set --export --universal VISUAL vim
else if command --search --quiet vi
set --export --universal EDITOR vi
set --export --universal VISUAL vi
end
set --export --universal SOPS_AGE_KEY_FILE "$XDG_CONFIG_HOME/sops/age/keys.txt"
# has_command fd && set -Ux FZF_DEFAULT_COMMAND 'fd --type f --hidden --follow --exclude .git'

View file

@ -1,9 +1,5 @@
[push]
default = current
[user]
name = Daniel Flanagan
email = daniel@lyte.dev
[filter "lfs"]
clean = git-lfs clean -- %f
@ -12,14 +8,14 @@
required = true
[core]
editor = nvim
editor = $EDITOR
excludesfile = /home/daniel/.home/.gitignore
[http "https://gopkg.in"]
followRedirects = true
[diff]
tool = nvimdiff
tool = $EDITOR -d
[difftool]
prompt = false
@ -37,8 +33,8 @@
ds = diff --staged
dt = difftool
f = fetch
l = log --pretty=format:'%h %ad%x09%an%x09%s' --date=short --decorate
graph = log --graph --abbrev-commit --decorate --oneline --all
l = log --graph --abbrev-commit --decorate --oneline --all
plainlog = log --pretty=format:'%h %ad%x09%an%x09%s' --date=short --decorate
ls = ls-files
mm = merge master
p = push
@ -49,14 +45,14 @@
sur = submodule update --remote
[merge]
tool = nvimdiff
tool = $EDITOR -d
conflictstyle = diff3
[mergetool]
prompt = false
[mergetool "nvimdiff"]
cmd = nvimdiff $BASE $LOCAL $REMOTE $MERGED -c '$wincmd w' -c '$wincmd J'
cmd = $EDITOR -d $BASE $LOCAL $REMOTE $MERGED -c '$wincmd w' -c '$wincmd J'
[pager]
branch = false
@ -67,24 +63,21 @@
-c 'silent execute \"normal gg2dd\"' \
-c 'silent setlocal nobuflisted buftype=nofile bufhidden=wipe noswapfile'
[url "git@github.com:postmates"]
insteadOf = https://github.com/postmates
[commit]
gpgsign = true
[gpg]
program = gpg2
[include]
path = $ENV_PATH/gitconfig
[color]
ui = auto
# This next lines include Netlify's Git Credential Helper configuration in your Git configuration.
[push]
default = current
[sendemail]
smtpserver = smtp.mailgun.org
smtpuser = daniel@lyte.dev
smtrpencryption = tls
smtpserverport = 587
[include]
path = /home/daniel/.home/.netlify/helper/git-config
[init]
defaultBranch = master
[branch]
autoSetupMerge = always
path = ~/.config/lytedev-env/host-layer-personal/gitconfig
path = ~/.config/lytedev-env/divvy/gitconfig

2
common/helix/config.toml Normal file
View file

@ -0,0 +1,2 @@
[keys.insert]
j = { k = "normal_mode" }

View file

@ -1,8 +1,10 @@
# Beware! This file is rewritten by htop when settings are changed in the interface.
# The parser is also very primitive, and not human-friendly.
htop_version=3.1.2
config_reader_min_version=2
fields=0 48 17 18 38 39 40 2 46 47 49 1
sort_key=47
sort_direction=1
sort_key=46
sort_direction=-1
tree_sort_key=0
tree_sort_direction=1
hide_kernel_threads=1
@ -11,6 +13,7 @@ shadow_other_users=0
show_thread_names=0
show_program_path=0
highlight_base_name=1
highlight_deleted_exe=1
highlight_megabytes=1
highlight_threads=1
highlight_changes=0
@ -18,8 +21,9 @@ highlight_changes_delay_secs=5
find_comm_in_cmdline=1
strip_exe_from_cmdline=1
show_merged_command=0
tree_view=0
tree_view=1
tree_view_always_by_pid=0
all_branches_collapsed=0
header_margin=1
detailed_cpu_time=0
cpu_count_from_one=1
@ -32,8 +36,9 @@ account_guest_in_cpu_meter=0
color_scheme=0
enable_mouse=1
delay=15
left_meters=LeftCPUs2 Memory Swap
left_meter_modes=1 1 1
right_meters=RightCPUs2 Tasks LoadAverage Uptime
right_meter_modes=1 2 2 2
hide_function_bar=0
header_layout=two_50_50
column_meters_0=LeftCPUs2 Memory Swap
column_meter_modes_0=1 1 1
column_meters_1=RightCPUs2 Tasks LoadAverage Uptime
column_meter_modes_1=1 2 2 2

View file

@ -1,13 +1,20 @@
font_family Iosevka
font_size 11.0
font_family IosevkaLyte
bold_font IosevkaLyte Heavy
italic_font IosevkaLyte Italic
bold_italic_font IosevkaLyte Heavy Italic
font_size 12.5
# use `kitty + list-fonts --psnames` to get the font's PostScript name
# font_features IosevkaLyte
# font_features Iosevka-Heavy +calt +dlig
# font_features Iosevka-Italic +calt +dlig
# font_features Iosevka-Heavy-Italic +calt +dlig
allow_remote_control yes
repaint_delay 5
input_delay 5
sync_to_monitor yes
disable_ligatures always
adjust_line_height 0
window_padding_width 10.0
window_margin_width 0.0
@ -16,8 +23,9 @@ map ctrl+shift+equal change_font_size all +0.5
map ctrl+shift+minus change_font_size all -0.5
map shift+insert paste_from_clipboard
map ctrl+shift+v paste_from_selection
map ctrl+shift+c copy_to_clipboard
enable_audio_bell no
enable_audio_bell yes
url_style single

View file

@ -0,0 +1,2 @@
host = '127.0.0.1'
line-ending = 'cr'

View file

@ -34,14 +34,22 @@ bind pager j half-down
bind pager J next-entry
bind pager K previous-entry
bind index \CR imap-fetch-mail
bind index \CR imap-fetch-mail
bind attach,index g first-entry
bind attach,index G last-entry
macro index,pager A s><return>y
macro index \' "<tag-pattern>~R !~D !~F<enter>\
<tag-prefix><save-message>+[Gmail]/All <enter>" \
"Archive"
set record = ""
set editor = "nvim"
set charset = "utf-8"
set header_cache = "~/.cache/mutt/headers"
set message_cachedir = "~/.cache/mutt/bodies"
set timeout = 60
set sort = reverse-date
set new_mail_command="notify-send 'New Email' '%n new messages, %u unread.' &"

View file

@ -1,5 +1,8 @@
/*
!/.gitignore
!/init.vim
!/nvim_lsp.lua
!/init.lua
!/ftplugin
!/lua
!/coc-settings.json
!/colors

View file

@ -0,0 +1 @@
/home/daniel/.home/.config/lytedev-dotfiles/common/colors/vim

View file

@ -0,0 +1,141 @@
hi clear
syntax reset
hi normal cterm=none ctermfg=7
hi bold cterm=bold
hi statusline cterm=none ctermfg=7 ctermbg=234
hi statuslinenc cterm=none ctermfg=234 ctermbg=0
hi inactivebuffer cterm=none ctermbg=234 ctermfg=7
hi activebuffer cterm=none ctermfg=0 ctermbg=4
hi dirtybuffer cterm=none ctermfg=0 ctermbg=1
hi activedirtybuffer cterm=none ctermfg=0 ctermbg=3
hi pmenu cterm=none ctermfg=7 ctermbg=236
hi pmenusel cterm=none ctermbg=4 ctermfg=0
hi pmenusbar cterm=none ctermbg=236 ctermfg=240
hi pmenuthumb cterm=none ctermbg=240 ctermfg=240
hi linenr cterm=none ctermfg=240
hi indentblanklinechar cterm=none ctermfg=236
hi signcolumn cterm=none ctermfg=234 ctermbg=0
hi matchparen cterm=none ctermbg=5 ctermfg=0
hi search cterm=bold ctermbg=4
hi incsearch cterm=bold ctermbg=4
hi todo cterm=none ctermfg=7 ctermbg=240
hi comment cterm=none ctermfg=240
hi keyword cterm=none ctermfg=7
hi operator cterm=none ctermfg=7
hi repeat cterm=none ctermfg=1
hi type cterm=none ctermfg=3
hi string cterm=none ctermfg=2
hi noise cterm=none ctermfg=5 ctermbg=0
hi statement cterm=none ctermfg=1 ctermbg=0
hi conditional cterm=none ctermfg=1 ctermbg=0
hi structure cterm=none ctermfg=4 ctermbg=0
hi special cterm=none ctermfg=5 ctermbg=0
hi preproc cterm=none ctermfg=1 ctermbg=0
hi identifier cterm=none ctermfg=4 ctermbg=0
hi constant cterm=none ctermfg=1
hi nontext ctermfg=0 ctermbg=0
hi diffoldfile cterm=none ctermfg=1
hi diffremoved cterm=none ctermfg=1
hi diffadded cterm=none ctermfg=2
" TODO: diagnostics popups, telescope dialogs
hi LspDiagnosticsSignWarning cterm=none ctermfg=1 ctermbg=0
hi lspdiagnosticsvirtualtextwarning cterm=none ctermfg=1 ctermbg=0
hi TelescopeBorder ctermfg=234
hi TelescopePromptBorder ctermfg=234
hi TelescopeResultsBorder ctermfg=234
hi TelescopePreviewBorder ctermfg=234
hi TelescopeSelection ctermbg=236 ctermfg=7
hi TelescopeSelectionCaret ctermfg=7
hi TelescopeMultiSelection ctermfg=7
hi TelescopeNormal ctermfg=7
hi TelescopeMatching ctermfg=0 ctermbg=4
hi TelescopePromptPrefix guifg=red
" vim tui elements
" call <sid>hi('Debug', s:gui08, '', s:cterm08, '', '', '')
" call <sid>hi('Directory', s:gui0D, '', s:cterm0D, '', '', '')
" call <sid>hi('Error', s:gui00, s:gui08, s:cterm00, s:cterm08, '', '')
" call <sid>hi('ErrorMsg', s:gui08, s:gui00, s:cterm08, s:cterm00, '', '')
" call <sid>hi('Exception', s:gui08, '', s:cterm08, '', '', '')
" call <sid>hi('FoldColumn', s:gui0C, s:gui01, s:cterm0C, s:cterm01, '', '')
" call <sid>hi('Folded', s:gui03, s:gui01, s:cterm03, s:cterm01, '', '')
" call <sid>hi('IncSearch', s:gui01, s:gui09, s:cterm01, s:cterm09, 'none', '')
" call <sid>hi('Italic', '', '', '', '', 'none', '')
" call <sid>hi('Macro', s:gui08, '', s:cterm08, '', '', '')
" call <sid>hi('MatchParen', s:gui00, s:gui03, s:cterm00, s:cterm03, '', '')
" call <sid>hi('ModeMsg', s:gui0B, '', s:cterm0B, '', '', '')
" call <sid>hi('MoreMsg', s:gui0B, '', s:cterm0B, '', '', '')
" call <sid>hi('Question', s:gui0D, '', s:cterm0D, '', '', '')
" call <sid>hi('Search', s:gui03, s:gui0A, s:cterm03, s:cterm0A, '', '')
" call <sid>hi('SpecialKey', s:gui03, '', s:cterm03, '', '', '')
" call <sid>hi('TooLong', s:gui08, '', s:cterm08, '', '', '')
" call <sid>hi('Underlined', s:gui08, '', s:cterm08, '', '', '')
" call <sid>hi('Visual', '', s:gui02, '', s:cterm02, '', '')
" call <sid>hi('VisualNOS', s:gui08, '', s:cterm08, '', '', '')
" call <sid>hi('WarningMsg', s:gui08, '', s:cterm08, '', '', '')
" call <sid>hi('WildMenu', s:gui08, s:gui0A, s:cterm08, '', '', '')
" call <sid>hi('Title', s:gui0D, '', s:cterm0D, '', 'none', '')
" call <sid>hi('Conceal', s:gui0D, s:gui00, s:cterm0D, s:cterm00, '', '')
" call <sid>hi('Cursor', s:gui00, s:gui05, s:cterm00, s:cterm05, '', '')
" call <sid>hi('NonText', s:gui03, '', s:cterm03, '', '', '')
" call <sid>hi('Normal', s:gui05, s:gui00, s:cterm05, s:cterm00, '', '')
" call <sid>hi('VertSplit', s:gui02, s:gui02, s:cterm02, s:cterm02, 'none', '')
" call <sid>hi('ColorColumn', '', s:gui01, '', s:cterm01, 'none', '')
" call <sid>hi('CursorColumn', '', s:gui01, '', s:cterm01, 'none', '')
" call <sid>hi('CursorLine', '', s:gui01, '', s:cterm01, 'none', '')
" call <sid>hi('CursorLineNr', s:gui03, s:gui01, s:cterm03, s:cterm01, '', '')
" call <sid>hi('PMenu', s:gui04, s:gui01, s:cterm04, s:cterm01, 'none', '')
" call <sid>hi('PMenuSel', s:gui01, s:gui04, s:cterm01, s:cterm04, '', '')
" call <sid>hi('TabLine', s:gui03, s:gui01, s:cterm03, s:cterm01, 'none', '')
" call <sid>hi('TabLineFill', s:gui03, s:gui01, s:cterm03, s:cterm01, 'none', '')
" call <sid>hi('TabLineSel', s:gui0B, s:gui01, s:cterm0B, s:cterm01, 'none', '')
" standard syntax
" call <sid>hi('Boolean', s:gui09, '', s:cterm09, '', '', '')
" call <sid>hi('Character', s:gui08, '', s:cterm08, '', '', '')
" call <sid>hi('Comment', s:gui03, '', s:cterm03, '', '', '')
" call <sid>hi('Conditional', s:gui0E, '', s:cterm0E, '', '', '')
" call <sid>hi('Constant', s:gui09, '', s:cterm09, '', '', '')
" call <sid>hi('Define', s:gui0E, '', s:cterm0E, '', 'none', '')
" call <sid>hi('Delimiter', s:gui0F, '', s:cterm0F, '', '', '')
" call <sid>hi('Float', s:gui09, '', s:cterm09, '', '', '')
" call <sid>hi('Function', s:gui0D, '', s:cterm0D, '', '', '')
" call <sid>hi('Identifier', s:gui08, '', s:cterm08, '', 'none', '')
" call <sid>hi('Include', s:gui0D, '', s:cterm0D, '', '', '')
" call <sid>hi('Keyword', s:gui0E, '', s:cterm0E, '', '', '')
" call <sid>hi('Label', s:gui0A, '', s:cterm0A, '', '', '')
" call <sid>hi('Number', s:gui09, '', s:cterm09, '', '', '')
" call <sid>hi('Operator', s:gui05, '', s:cterm05, '', 'none', '')
" call <sid>hi('PreProc', s:gui0A, '', s:cterm0A, '', '', '')
" call <sid>hi('Repeat', s:gui0A, '', s:cterm0A, '', '', '')
" call <sid>hi('Special', s:gui0C, '', s:cterm0C, '', '', '')
" call <sid>hi('SpecialChar', s:gui0F, '', s:cterm0F, '', '', '')
" call <sid>hi('Statement', s:gui08, '', s:cterm08, '', '', '')
" call <sid>hi('StorageClass', s:gui0A, '', s:cterm0A, '', '', '')
" call <sid>hi('String', s:gui0B, '', s:cterm0B, '', '', '')
" call <sid>hi('Structure', s:gui0E, '', s:cterm0E, '', '', '')
" call <sid>hi('Tag', s:gui0A, '', s:cterm0A, '', '', '')
" call <sid>hi('Todo', s:gui0A, s:gui01, s:cterm0A, s:cterm01, '', '')
" call <sid>hi('Type', s:gui0A, '', s:cterm0A, '', 'none', '')
" call <sid>hi('Typedef', s:gui0A, '', s:cterm0A, '', '', '')
" call <sid>hi('DiffAdd', s:gui0B, s:gui01, s:cterm0B, s:cterm01, '', '')
" call <sid>hi('DiffChange', s:gui03, s:gui01, s:cterm03, s:cterm01, '', '')
" call <sid>hi('DiffDelete', s:gui08, s:gui01, s:cterm08, s:cterm01, '', '')
" call <sid>hi('DiffText', s:gui0D, s:gui01, s:cterm0D, s:cterm01, '', '')
" call <sid>hi('DiffAdded', s:gui0B, s:gui00, s:cterm0B, s:cterm00, '', '')
" call <sid>hi('DiffFile', s:gui08, s:gui00, s:cterm08, s:cterm00, '', '')
" call <sid>hi('DiffNewFile', s:gui0B, s:gui00, s:cterm0B, s:cterm00, '', '')
" call <sid>hi('DiffLine', s:gui0D, s:gui00, s:cterm0D, s:cterm00, '', '')
" call <sid>hi('DiffRemoved', s:gui08, s:gui00, s:cterm08, s:cterm00, '', '')
" call <sid>hi('SpellBad', '', s:gui00, '', s:cterm00, 'undercurl', s:gui08)
" call <sid>hi('SpellLocal', '', s:gui00, '', s:cterm00, 'undercurl', s:gui0C)
" call <sid>hi('SpellCap', '', s:gui00, '', s:cterm00, 'undercurl', s:gui0D)
" call <sid>hi('SpellRare', '', s:gui00, '', s:cterm00, 'undercurl', s:gui0E)

7
common/neovim/init.lua Normal file
View file

@ -0,0 +1,7 @@
vim.g.vimdir = os.getenv('XDG_CONFIG_HOME') .. '/nvim'
require'plugins'
require'options'
require'keymap'
require'statusline'
require'lsp'

View file

@ -1,248 +0,0 @@
set fileencoding=utf8
let $vimdir = $XDG_CONFIG_HOME.'/nvim'
if empty(glob($vimdir.'/autoload/plug.vim'))
silent !curl -fLo $vimdir/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $vimdir.'init.vim'
endif
let g:completion_enable_auto_popup = 0
let g:indent_guide_auto_colors = 1
let g:indent_guides_enable_on_vim_startup = 1
let g:jsonnet_fmt_on_save = 0
let g:skipview_files = ['COMMIT_EDITMSG']
" let g:fzf_preview_window = ['down:40%:hidden', 'ctrl-/']
call plug#begin($vimdir.'/plugged')
Plug 'junegunn/vim-plug' " plugin manager should manage itself
Plug 'sheerun/vim-polyglot' " handles language-specific configuration
Plug 'neovim/nvim-lspconfig' " deeper language integration via language servers
Plug 'nvim-lua/completion-nvim' " language server completion
Plug 'junegunn/fzf' " fzf
Plug 'junegunn/fzf.vim' " helpers for using fzf in vim
Plug 'editorconfig/editorconfig-vim' " loads project-specific editor settings
Plug 'tpope/vim-sleuth' " try and detect indent method
Plug 'vim-scripts/LargeFile' " gracefully handle very large files
Plug 'vim-scripts/restore_view.vim' " persistent buffer views
Plug 'nathanaelkane/vim-indent-guides' " indentation guides
Plug 'christoomey/vim-tmux-navigator' " allow window navigation to play nicely with tmux
Plug 'tpope/vim-commentary' " toggle comments in code easily
Plug 'tpope/vim-repeat' " better vim repeating for plugin-provided actions
Plug 'machakann/vim-sandwich' " quickly modify text surrounding objects
Plug 'michaeljsmith/vim-indent-object' " adds an indentation level text object
Plug 'bkad/CamelCaseMotion' " camel case and underscore word movements
Plug 'wellle/targets.vim' " adds some more handy text objects
Plug 'tpope/vim-obsession' " even better session handling
Plug 'dhruvasagar/vim-prosession' " even better session handling
Plug 'dhruvasagar/vim-prosession' " even better session handling
Plug 'neoclide/coc.nvim', {'branch': 'release'}
call plug#end()
" luafile $vimdir/lsp.lua
" autocmd BufEnter * lua require('completion').on_attach()
filetype on
filetype indent on
filetype plugin on
" use :h option-list if you need to know what these do
set encoding=utf8
set tabstop=2 shiftwidth=2 softtabstop=2 noexpandtab
set autoindent smartindent
set list nostartofline listchars=trail,tab:\ \ ,trail:~
set linebreak formatoptions=crql1jn " TODO: see if there is more in `:h fo-table`
set synmaxcol=200
set lazyredraw
set scrolloff=8 sidescrolloff=15
set mouse=a
set splitright splitbelow
set noerrorbells visualbell t_vb=
set nobackup nowritebackup noswapfile
set timeout ttimeoutlen=100 timeoutlen=150
set hidden shortmess+=Iac
set history=1000
set undofile undodir=$vimdir/undo undolevels=1000 undoreload=10000
set spellfile=$vimdir/spell/en.utf-8.add
set ignorecase smartcase incsearch wrapscan hlsearch
set foldmethod=syntax foldlevel=99 foldnestmax=10 foldlevelstart=99 " TODO: get good at folding
set noautowrite autochdir autoread
set nomodeline noshowmode noshowcmd laststatus=2 noruler
set clipboard+=unnamedplus
set t_Co=256
let &fcs = 'eob: '
syntax enable
colorscheme base16-donokai
hi Search cterm=NONE ctermbg=blue ctermfg=black
hi LineNr ctermbg=none ctermfg=8
hi CursorLineNr ctermbg=18 ctermfg=gray
hi IndentGuidesEven ctermbg=18
hi Normal ctermbg=NONE
hi ColorColumn ctermbg=18
hi TooLongColorColumn ctermbg=18 ctermfg=1
hi ActiveBuffer ctermbg=4 ctermfg=0
hi DirtyBuffer ctermbg=3 ctermfg=0
hi StatusLine ctermbg=18 ctermfg=7
hi StatusLineNC ctermbg=18 ctermfg=7
call matchadd('ColorColumn', '\%81v', 100)
call matchadd('TooLongColorColumn', '\%121v', 200)
command! W write
inoremap jj <Esc>
inoremap jJ <Esc>
inoremap Jj <Esc>
inoremap JJ <Esc>
inoremap jk <Esc>
inoremap jK <Esc>
inoremap Jk <Esc>
inoremap JK <Esc>
nnoremap <C-q> :qa<CR>
inoremap <C-q> <Esc><C-q>
nnoremap <C-p> :GitFiles<CR>
nnoremap <C-o> :Files<CR>
nnoremap <C-u> :GFiles?<CR>
nnoremap <C-b> :Buffers<CR>
nnoremap <C-h> :TmuxNavigateLeft<CR>
nnoremap <C-j> :TmuxNavigateDown<CR>
nnoremap <C-k> :TmuxNavigateUp<CR>
nnoremap <C-l> :TmuxNavigateRight<CR>
tnoremap <C-h> <C-\><C-n>:TmuxNavigateLeft<CR>
tnoremap <C-j> <C-\><C-n>:TmuxNavigateDown<CR>
tnoremap <C-k> <C-\><C-n>:TmuxNavigateUp<CR>
tnoremap <C-l> <C-\><C-n>:TmuxNavigateRight<CR>
map <silent> ,w <Plug>CamelCaseMotion_w
map <silent> ,b <Plug>CamelCaseMotion_b
map <silent> ,e <Plug>CamelCaseMotion_e
map <silent> ,ge <Plug>CamelCaseMotion_ge
omap <silent> ib <Plug>CamelCaseMotion_ib
xmap <silent> ib <Plug>CamelCaseMotion_ib
omap <silent> ie <Plug>CamelCaseMotion_ie
xmap <silent> ie <Plug>CamelCaseMotion_ie
map <F3> mw:%s/\s\+$//<CR>:let @/ = ""<CR>'w
map <F4> :setlocal spell!<CR>
nnoremap <expr> n 'Nn'[v:searchforward]
nnoremap <expr> N 'nN'[v:searchforward]
cnoremap <c-n> <down>
cnoremap <c-p> <up>
xnoremap < <gv
xnoremap > >gv
nnoremap gd :call CocAction('jumpDefinition')<CR>
" TODO: learn about the wildmenu `q:`
let mapleader = "\<Space>"
nnoremap <silent> <leader>r :source $vimdir/init.vim<CR>:echo 'Reloaded init.vim'<CR>
nnoremap <silent> <leader>gv :e $vimdir/init.vim<CR>
nnoremap <silent> <leader>w :bd<CR>
nnoremap <silent> <leader>h :b#<CR>
nnoremap <silent> <leader>k :bnext<CR>
nnoremap <silent> <leader>j :bprevious<CR>
nnoremap <leader>/ :let @/ = ""<CR>:<BACKSPACE>
nnoremap <leader>t :split<CR>:term<CR>:resize 24<CR>:startinsert<CR>
tnoremap <C-w> <C-\><C-n>:q!<CR>
function! NeatFoldText()
" TODO: finish this!
let lines_count = v:foldend - v:foldstart + 1
let foldchar = matchstr(&fillchars, 'fold:\zs.')
let foldtextstart = strpart('^' . repeat(foldchar, v:foldlevel*2) . line, 0, (winwidth(0)*2)/3)
let foldtextend = printf("%s %".(winwidth(0)-20)."dL", foldtextstart, getline(v:foldstart), lines_count)
let foldtextlength = strlen(substitute(foldtextstart . foldtextend, '.', 'x', 'g')) + &foldcolumn
return printf("%s%d", substitute(getline(v:foldstart), "^.", ">"), lines_count)
endfunction
set foldtext=NeatFoldText()
" TODO: only update this portion when needed instead of every render?
function! StatusLineBufferByNum(bufnum)
let l:bufinfo = getbufinfo(a:bufnum)[0]
let l:prefix = ' %#InactiveBuffer#'
let l:suffix = '%* '
if l:bufinfo.changed
let l:prefix = '%#DirtyBuffer# '
let l:suffix = ' %*'
end
if l:bufinfo['hidden'] == 0 && index(l:bufinfo['windows'], g:statusline_winid) >= 0
let l:prefix = '%#ActiveBuffer# '
let l:suffix = ' %*'
if l:bufinfo.changed
let l:prefix = '%#ActiveBuffer# *'
let l:suffix = ' %*'
end
endif
return l:prefix . fnamemodify(bufname(a:bufnum), ':t') . l:suffix
endfunction
au BufReadPost * | if stridx(&ft, 'commit') >= 0 | exe "startinsert!" | endif
let g:status_line_max_length = 5
function! StatusLineBuffers()
" TODO: mark buffers with unsaved changes
let l:active_index = -1
let l:acc = []
for l:bufnum in nvim_list_bufs()
let l:bufinfo = getbufinfo(l:bufnum)[0]
if l:bufinfo.listed == 0
continue
end
let l:entry = StatusLineBufferByNum(bufnum)
let l:acc = add(l:acc, l:entry)
if l:entry =~ "^%#ActiveBuffer#"
let l:active_index = index(l:acc, l:entry)
endif
endfor
if l:active_index >= 0
" TODO: instead implement this as a wraparound carousel?
let l:offset = g:status_line_max_length / 2
let l:min_buf_num = max([0, (l:active_index - offset)])
let l:max_buf_num = min([(len(l:acc) - 1), (l:min_buf_num + g:status_line_max_length - 1)])
let l:min_buf_num = max([0, (l:max_buf_num - g:status_line_max_length + 1)])
let l:buflist = join(l:acc[(l:min_buf_num):(l:max_buf_num)], '')
let l:prefix = ""
let l:suffix = ""
if l:min_buf_num > 0
let l:prefix = "< "
endif
if l:max_buf_num < len(l:acc) - 1
let l:suffix = " >"
endif
return l:prefix . l:buflist . l:suffix
else
return join(l:acc, '')
endif
endfunction
function! StatusLine()
" try
return StatusLineBuffers().'%*%=%c,%l/%L (%p%%)'
" catch
" return 'buflisterr%*%=%c,%l/%L (%p%%)'
" endtry
endfunction
augroup slime
au!
autocmd BufNewFile,BufRead *.slimleex set syntax=slim
augroup END
" set laststatus=0 showtabline tabline=%!StatusLine()
set statusline=%!StatusLine()
imap <silent> <c-n> <Plug>(completion_trigger)

View file

View file

@ -0,0 +1,79 @@
for _, keys in ipairs { 'jj', 'jJ', 'Jj', 'JJ', 'jk', 'jK', 'Jk', 'JK' } do vim.api.nvim_set_keymap('i', keys, '<Esc>', {}) end
local m = {
s = { silent = true },
n = { noremap = true },
sn = { silent = true, noremap = true },
}
local keymap = {
n = {
['<leader>/'] = { ':let @/ = ""<cr>:<BACKSPACE>', m.s },
['<leader>r'] = { ':luafile ' .. vim.g.vimdir .. '/init.lua<cr>:echo \'Reloaded init.lua\'<cr>', m.s },
['<leader>gv'] = { ':e ' .. vim.g.vimdir .. '/init.lua<cr>', m.s },
['<leader>w'] = { ':bd<cr>', m.s },
['<leader>h'] = { ':b#<cr>', m.s },
['<leader>k'] = { ':bnext<cr>', m.s },
['<leader>j'] = { ':bprevious<cr>', m.s },
['<c-q>'] = ':qa<cr>',
['<c-p>'] = '<cmd>Telescope git_files<cr>',
['<c-g>'] = '<cmd>Telescope live_grep<cr>',
['<c-b>'] = '<cmd>Telescope buffers<cr>',
['<leader>t'] = '<cmd>Telescope help_tags<cr>',
['<c-h>'] = ':TmuxNavigateLeft<cr>',
['<c-j>'] = ':TmuxNavigateDown<cr>',
['<c-k>'] = ':TmuxNavigateUp<cr>',
['<c-l>'] = ':TmuxNavigateRight<cr>',
['<expr> n'] = "'Nn'[v:searchforward]",
['<expr> N'] = "'nN'[v:searchforward]",
['<c-m>'] = ':lua SynGroup()<cr>',
['<leader>s'] = "<cmd>SessionToggle<cr><cmd>echo 'Persisting Session: ' .. g:persisting .. ' (' .. getcwd() .. ')'<cr>",
['<leader>S'] = "<cmd>SessionSave<cr><cmd>echo 'Saved Session: ' .. getcwd()<cr>",
['<leader>l'] = "<cmd>SessionLoad<cr><cmd>echo 'Loaded Session: ' .. getcwd()<cr>",
['<leader>L'] = "<cmd>SessionLoadLast<cr><cmd>echo 'Loaded Last Session: ' .. getcwd()<cr>",
['<leader>d'] = "<cmd>SessionDelete<cr><cmd>echo 'Deleted Session for cwd: ' .. getcwd()<cr>",
},
-- terminal bindings
t = {},
[''] = {
['<space>'] = { '<nop>', m.sn },
-- remove trailing whitespace
['<f3>'] = 'mw:%s/\\s\\+$//<cr>:let @/ = ""<cr>\'w',
['<leader>gs'] = ':setlocal spell!<cr>',
[',w'] = { '<Plug>CamelCaseMotion_w', m.s },
[',b'] = { '<Plug>CamelCaseMotion_b', m.s },
[',e'] = { '<Plug>CamelCaseMotion_e', m.s },
[',ge'] = { '<Plug>CamelCaseMotion_ge', m.s },
},
o = {
['ib'] = { '<Plug>CamelCaseMotion_ib', m.s },
['ie'] = { '<Plug>CamelCaseMotion_ie', m.s },
},
x = {
['<'] = '<gv',
['>'] = '>gv',
['ib'] = { '<Plug>CamelCaseMotion_ib', m.s },
['ie'] = { '<Plug>CamelCaseMotion_ie', m.s },
},
i = {
['<c-q>'] = '<esc><c-q>',
},
}
for mode, mappings in pairs(keymap) do
for key, bind in pairs(mappings) do
if type(bind) == 'table' then
vim.api.nvim_set_keymap(mode, key, bind[1], bind[2])
else
vim.api.nvim_set_keymap(mode, key, bind, {})
end
end
end

89
common/neovim/lua/lsp.lua Normal file
View file

@ -0,0 +1,89 @@
local lsp = require 'lspconfig'
-- local coq = require'coq'
-- TODO: replace with nvim lsp bindings for jumping to next linting issue?
--vim.api.nvim_set_keymap('n', '[d', '<cmd>)<CR>', opts)
local opts = {
noremap = true,
silent = true,
}
local lsp_format = require 'lsp-format'
local on_attach = function(client, bufnr)
lsp_format.on_attach(client)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>e', '<cmd>lua vim.diagnostic.open_float()<cr>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'g]', '<cmd>lua vim.diagnostic.goto_next()<cr>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'g[', '<cmd>lua vim.diagnostic.goto_prev()<cr>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<C-a>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'i', '<C-a>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>wa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>wr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>f', '<cmd>lua vim.lsp.buf.formatting_seq_sync()<CR>', opts)
end
local capabilities = require 'cmp_nvim_lsp'.update_capabilities(vim.lsp.protocol.make_client_capabilities())
local common_config = {
capabilities = capabilities,
on_attach = on_attach,
flags = {
debounce_text_changes = 150
},
}
local lsp_configs = {
gopls = {},
elixirls = {
cmd = { vim.fn.expand '~/.local/share/nvim/lsp_servers/elixir/elixir-ls/language_server.sh' },
settings = {
elixirLS = {
dialyzerEnabled = true,
fetchDeps = false,
}
}
},
sumneko_lua = {
settings = {
Lua = {
diagnostics = {
globals = { 'vim' }
}
}
}
},
vimls = {},
rust_analyzer = {},
tsserver = {},
pylsp = {},
denols = {
root_dir = lsp.util.root_pattern("deno.json"),
},
}
for server, config in pairs(lsp_configs) do
for k, v in pairs(common_config) do config[k] = v end
lsp[server].setup(config)
end
local lsp_installer = require 'nvim-lsp-installer'
lsp_installer.on_server_ready(function(server)
local server_opts = {}
-- if server.name == "elixirls" then
-- server_opts.cmd = { vim.fn.expand'~/.local/share/nvim/lsp_servers/elixir/elixir-ls/language_server.sh' }
-- end
server:setup(server_opts)
end)

View file

@ -0,0 +1,105 @@
local globals = {
coq_settings = {
['display.icons.mode'] = 'none'
},
dashboard_default_executive = 'telescope',
mapleader = ' ',
maplocalleader = ' ',
completion_enable_auto_popup = 0,
skipview_files = {'COMMIT_EDITMSG'},
indent_blankline_char = '',
indent_blankline_filetype_exclude = {'help', 'packer'},
indent_blankline_buftype_exclude = {'terminal', 'nofile'},
indent_blankline_char_highlight = 'LineNr',
svelte_preprocessors = {'typescript', 'coffeescript', 'sass', 'pug'},
svelte_preprocessor_tags = {
{name = 'sass', tag = 'lang', as = 'sass'},
{name = 'coffeescript', tag = 'lang', as = 'coffeescript'},
{name = 'pug', tag = 'pug', as = 'pug'},
},
svelte_indent_script = 0,
svelte_indent_style = 0,
}
for k,v in pairs(globals) do vim.g[k] = v end
local options = {
clipboard = 'unnamedplus',
inccommand = 'nosplit',
tabstop = 2,
softtabstop = 2,
shiftwidth = 2,
smartindent = true,
list = true,
listchars = 'trail:·,tab: ',
linebreak = true,
formatoptions = 'crql1jn',
synmaxcol = 200,
lazyredraw = true,
scrolloff = 8,
sidescrolloff = 15,
mouse = 'a',
splitright = true,
splitbelow = true,
errorbells = false,
visualbell = true,
backup = false,
writebackup = false,
swapfile = false,
timeout = true,
timeoutlen = 150,
hidden = true,
shortmess = 'filnxToOFIac',
history = 1000,
undofile = true,
undodir = vim.fn.stdpath'data' .. '/undo',
undolevels = 1000,
undoreload = 1000,
spellfile = vim.fn.stdpath'data' .. '/spell/en.utf-8.add',
ignorecase = true,
smartcase = true,
incsearch = true,
wrapscan = true,
hlsearch = true,
foldmethod = 'syntax',
foldlevel = 99,
foldnestmax = 10,
foldlevelstart = 99,
autowrite = false,
autochdir = false,
autoread = true,
modeline = false,
showmode = false,
showcmd = false,
laststatus = 2,
ruler = false,
number = true,
}
for k,v in pairs(options) do
vim.o[k] = v
end
vim.api.nvim_command'colorscheme donokai'
function SynGroup()
local s = vim.fn.synID(vim.fn.line('.'), vim.fn.col('.'), 1)
print(vim.fn.synIDattr(s, 'name') .. ' -> ' .. vim.fn.synIDattr(vim.fn.synIDtrans(s), 'name'))
end
vim.api.nvim_exec([[
au! TextYankPost * silent! lua vim.highlight.on_yank { higroup='Search', timeout=200 }
au! FileType gitcommit exec 'norm gg' | startinsert!
au! BufNewFile,BufRead *.slimleex set syntax=slime
command! W write
]], true)
-- au! VimEnter * COQnow -s
function NeatFoldText()
-- TODO: finish this!
-- local lines_count = vim.foldend - vim.foldstart + 1
-- local foldchar = vim.fn.matchstr(vim.fillchars, 'fold:\\zs.')
-- local foldtextstart = vim.fn.strpart('^' . repeat(foldchar, v:foldlevel*2) . line, 0, (winwidth(0)*2)/3)
-- let foldtextend = printf("%s %".(winwidth(0)-20)."dL", foldtextstart, getline(v:foldstart), lines_count)
-- let foldtextlength = strlen(substitute(foldtextstart . foldtextend, '.', 'x', 'g')) + &foldcolumn
-- return printf("%s%d", substitute(getline(v:foldstart), "^.", ">"), lines_count)
end
-- set foldtext=NeatFoldText()

View file

@ -0,0 +1,192 @@
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
local has_words_before = function()
local line, col = vim.api.nvim_win_get_cursor(0)
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
end
local packer = require 'packer'
packer.startup(function()
local plugins = {
'wbthomason/packer.nvim', -- neovim plugin manager
'vim-scripts/LargeFile', -- degrade gracefully with large files
'tpope/vim-repeat', -- enable repeat for plugin maps
'tpope/vim-sleuth', -- use whatever whitespace is in the file
'editorconfig/editorconfig-vim', -- handle .editorconfig files
'christoomey/vim-tmux-navigator', -- navigate vim splits and tmux panes fluidly
'machakann/vim-sandwich', -- edit surrounding characters
'michaeljsmith/vim-indent-object', -- adds indent-level text objects
-- 'wellle/targets.vim', -- add many other text objects
'bkad/CamelCaseMotion', -- invaluable motions for properly operating on various casings
{
-- session management
'olimorris/persisted.nvim',
config = function()
local should_autoload = #vim.v.argv == 1
require 'persisted'.setup {
autoload = should_autoload,
autosave = should_autoload,
}
end
},
{
-- toggle comments
'terrortylor/nvim-comment',
config = function()
require 'nvim_comment'.setup()
end
},
{
-- fuzzy finder
'nvim-telescope/telescope.nvim',
requires = {
'nvim-lua/popup.nvim',
'nvim-lua/plenary.nvim',
}
},
{
'nvim-telescope/telescope-fzf-native.nvim',
run = 'make',
},
{
'tzachar/cmp-fuzzy-path',
requires = { 'hrsh7th/nvim-cmp', 'tzachar/fuzzy.nvim' },
},
-- TODO: add keymap <leader>ig for toggling these
'lukas-reineke/indent-blankline.nvim', -- indentation guide lines
'L3MON4D3/LuaSnip',
'neovim/nvim-lspconfig', -- language server configuration helper
'williamboman/nvim-lsp-installer', -- plugin containing installation commands for many language servers
'hrsh7th/cmp-nvim-lsp-signature-help',
'hrsh7th/cmp-nvim-lsp', -- add lsp to completion engine
'hrsh7th/cmp-buffer', -- add buffer information to completion engine
'hrsh7th/cmp-path', -- add filesystem information to complete enging
'hrsh7th/cmp-cmdline', -- add completion for vim commands
'onsails/lspkind-nvim',
'saadparwaiz1/cmp_luasnip',
{
-- completion engine
'hrsh7th/nvim-cmp',
config = function()
local cmp = require 'cmp'
local luasnip = require 'luasnip'
local prev_item = function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end
local next_item = function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
elseif has_words_before() then
cmp.complete()
else
fallback()
end
end
cmp.setup {
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
mapping = {
['<C-b>'] = cmp.mapping(cmp.mapping.scroll_docs(-4), { 'i', 'c' }),
['<C-f>'] = cmp.mapping(cmp.mapping.scroll_docs(4), { 'i', 'c' }),
['<C-Space>'] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }),
['<C-y>'] = cmp.config.disable,
['<C-e>'] = cmp.mapping {
i = cmp.mapping.abort(),
c = cmp.mapping.close(),
},
['<CR>'] = cmp.mapping.confirm { select = false },
["<Tab>"] = cmp.mapping(next_item, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(prev_item, { "i", "s" }),
['<C-n>'] = cmp.mapping(next_item, { "i", "s" }),
['<C-p>'] = cmp.mapping(prev_item, { "i", "s" }),
},
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'nvim_lsp_signature_help' },
{ name = 'luasnip' },
}, {
{ name = 'buffer' },
{ name = 'path' },
{ name = 'fuzzy_path' },
}),
formatting = {
format = require("lspkind").cmp_format {
with_text = true,
menu = {
nvim_lsp = "[LSP]",
},
}
},
}
cmp.setup.cmdline('/', {
-- mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = 'buffer' },
{ name = 'fuzzy_path' },
}
})
cmp.setup.cmdline(':', {
-- mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = 'path' }
}, {
{ name = 'cmdline' }
})
})
end,
},
-- TODO: automate this installation process of :COQdeps<cr>:COQnow<cr>
-- {'ms-jpq/coq_nvim', branch = 'coq'},
-- {'ms-jpq/coq.thirdparty', branch = '3p'},
{
-- syntax highlighting and indentation
'nvim-treesitter/nvim-treesitter',
run = ':TSUpdate',
config = function()
require 'nvim-treesitter.configs'.setup {
ensure_installed = "all",
sync_install = false,
ignore_install = {},
indent = {
enable = true,
},
highlight = {
enable = true,
disable = {},
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages
-- additional_vim_regex_highlighting = false,
},
}
end
},
'lukas-reineke/lsp-format.nvim',
}
for _, plugin in pairs(plugins) do packer.use(plugin) end
end)

View file

@ -0,0 +1,86 @@
local fn = vim.fn
local api = vim.api
local status_line_max_length = 5
-- TODO: only update this portion when needed instead of every render?
local status_line_buffer_by_num = function(bufnum)
local is_active = false
local bufinfo = fn.getbufinfo(bufnum)[1]
local prefix = ' %#InactiveBuffer#'
local suffix = '%* '
if bufinfo.changed == 1 then
prefix = '%#DirtyBuffer# '
suffix = ' %*'
end
local windex = fn.index(bufinfo.windows, vim.g.statusline_winid)
if bufinfo.hidden and windex >= 0 then
is_active = true
prefix = '%#ActiveBuffer# '
suffix = ' %*'
if bufinfo.changed == 1 then
prefix = '%#ActiveDirtyBuffer# *'
suffix = ' %*'
end
end
return (prefix .. fn.fnamemodify(fn.bufname(bufnum), ':t') .. suffix), is_active
end
local status_line_buffers = function()
-- TODO: mark buffers with unsaved changes
local active_index = -1
local acc = {}
for _,bufnum in ipairs(api.nvim_list_bufs()) do
local bufinfo = fn.getbufinfo(bufnum)[1]
if bufinfo.listed ~= 0 then
local entry, is_active = status_line_buffer_by_num(bufnum)
table.insert(acc, entry)
if is_active then
active_index = #acc
end
end
end
if active_index >= 0 then
-- TODO: instead implement this as a wraparound carousel?
local offset = status_line_max_length / 2
local min_buf_num = math.max(0, (active_index - offset))
local max_buf_num = math.min(#acc - 1, min_buf_num + status_line_max_length - 1)
min_buf_num = math.max(0, max_buf_num - status_line_max_length + 1)
local buflist = table.concat({unpack(acc, min_buf_num+1, max_buf_num+1)}, '')
local prefix = ''
local suffix = ''
if min_buf_num > 0 then
prefix = '< '
end
if max_buf_num < (#acc - 1) then
suffix = ' >'
end
return prefix .. buflist .. suffix
else
local suffix = ''
if #acc - 1 >status_line_max_length then
suffix = ' >'
end
local buflist = table.concat({unpack(acc, 1, math.min(#acc, status_line_max_length))}, '')
return buflist .. suffix .. active_index
end
end
local whitespace = function()
local result = ""
if vim.o.expandtab == true then
result = result .. vim.o.shiftwidth .. "S"
else
result = result .. vim.o.tabstop .. "T"
end
return result
end
function StatusLine()
return status_line_buffers() .. '%*%=%{&filetype} %l;%c (%p%%/%L) ' .. whitespace()
end
vim.o.statusline = '%!v:lua.StatusLine()'

View file

@ -1,6 +0,0 @@
-- local completion = require('completion')
local lsp = require('lspconfig')
lsp.elixirls.setup{}
lsp.sumneko_lua.setup{}
lsp.vimls.setup{}

View file

@ -4,7 +4,7 @@ SPLIT="$SPLIT"
TERMINAL="$TERMINAL"
USE_SCOPE="${USE_SCOPE:-0}"
IN_KITTY=0
[ -n "$KITTY_WINDOW_ID" ] && kitty @ ls --no-response >/dev/null 2>&1 && IN_KITTY=1
[ -z "$SSH_CONNECTION" ] && [ -n "$KITTY_WINDOW_ID" ] && kitty @ ls --no-response >/dev/null 2>&1 && IN_KITTY=1
if [ -e "${TMUX%%,*}" ] && tmux -V | grep -q '[ -][3456789]\.'; then
TERMINAL=tmux
@ -14,6 +14,9 @@ else
TERMINAL="${TERMINAL:-xterm}"
fi
# we can't actually work if we're about to try the kitty method over SSH, so just exit
[ -n "$SSH_CONNECTION" ] && [ "$TERMINAL" = "kitty" ] && exit 0
if [ -z "$SPLIT" ] && [ $(($(tput lines) * 2)) -gt "$(tput cols)" ]; then
SPLIT='h'
elif [ "$SPLIT" != 'h' ]; then

3
common/pgcli/config Normal file
View file

@ -0,0 +1,3 @@
[main]
expand = True
enable_pager = False

95
common/sc-im/lua/dice.lua Normal file
View file

@ -0,0 +1,95 @@
local os = require "os"
local math = require "math"
math.randomseed(os.clock())
function table.tostring(self, indent, done)
local result = ""
done = done or {}
indent = indent or 0
if type(self) == "table" then
for key, value in pairs(self) do
result = result .. string.rep(" ", indent)
if type(value) == "table" and not done[value] then
done[value] = true
result = result ..
string.format(
"[%s] => table\n",
tostring(key)
) ..
"{\n" ..
table.tostring(value, indent + 2, done) ..
"}\n"
else
result = result ..
string.format("[%s] => %s\n",
tostring(key),
tostring(value)
)
end
end
else
result = result .. self .. "\n"
end
return result
end
function log(s)
s = "[timestamp: " .. tostring(os.time()) .. "]\n" .. s
local out = s:gsub("\n", "\n ")
local file = io.open("/tmp/sc-im-dice.log", "a+")
file:write("\n")
file:write(out)
io.close(file)
end
local dstr_matcher = "(%d*)d(%d+)"
function dstr(n, s, fl)
n = tonumber(n) or 1
local sum = 0
for di = 1, n do
sum = sum + math.random(1, tonumber(s))
end
return sum
end
function rolls(s)
local pieces = {}
for nd, ds in s:gmatch(dstr_matcher) do
local sum = dstr(tonumber(nd), tonumber(ds))
pieces[#pieces+1] = {
tostring(nd) .. "d" .. tostring(ds),
tostring(sum)
}
end
return pieces
end
function replacerolls(s, rolls)
local result = s
for k, n in ipairs(rolls) do
result = result:gsub(n[1], n[2], 1)
end
return result
end
function evalreturn(s)
local f = loadstring("return " .. s)
return f()
end
function sc_parserollstr(s)
local r = rolls(s)
log(table.tostring(r))
return evalreturn(replacerolls(s, r))
end
function sc_rollres(c, r)
local os = require "os"
local seed = (os.time() + os.clock()) * 10000000
math.randomseed(seed)
log("Setting Seed: " .. tostring(seed))
local sum = sc_parserollstr(sc.lgetstr(c, r))
sc.lsetnum(c, r, sum)
end

0
common/sc-im/lua/h.lua Normal file
View file

20
common/sc-im/scimrc Normal file
View file

@ -0,0 +1,20 @@
set autocalc
set numeric
set numeric_decimal=0
set overlap
set xlsx_readformulas
color "type=HEADINGS fg=WHITE bg=BLACK bold=0 dim=0 standout=0 reverse=0"
color "type=HEADINGS_ODD fg=WHITE bg=BLACK bold=0 dim=0 standout=0 reverse=0"
color "type=CELL_SELECTION_SC fg=WHITE bg=BLACK bold=1 dim=0 standout=1"
color "type=CELL_SELECTION fg=WHITE bg=BLACK bold=1 dim=0 standout=1"
color "type=STRG fg=WHITE bg=BLACK bold=0 dim=1"
color "type=NUMB fg=BLUE bg=BLACK bold=0 dim=1"
color "type=EXPRESSION fg=GREEN bg=BLACK bold=0 dim=1"
color "type=CELL_NEGATIVE fg=RED bg=BLACK bold=0 dim=1"
nmap "J" "<C-j>"
nmap "fi" ":format \"0\"<cr>"
nmap "B" "Vir"
nmap " " "E<cr>k"

88
common/terminal_colors Executable file
View file

@ -0,0 +1,88 @@
#!/bin/sh
if [ "${TERM%%-*}" = 'linux' ]; then
return 2>/dev/null || exit 0
fi
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"
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
c() {
t="${1}"; shift
c="${1}"; shift
for n in "$@"; do
printf "$t" "$n" "$c"
done
}
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
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
cv $white 10
cv $black 11
cc ";7" 12
fi
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 printf_template
unset printf_template_var
unset printf_template_custom

View file

@ -1,24 +1,28 @@
unbind C-b
set -g prefix C-s
bind-key s send-prefix
bind s send-prefix
bind-key v split-window -h
bind-key b split-window
bind-key T source-file "$HOME/.tmux.conf" \; display-message "Reloaded $HOME/.tmux.conf"
bind-key O display-message "#(tmux-save-buffer '#S')"
bind-key H set -s status
bind-key -n C-l select-pane -R
bind-key -n C-k select-pane -U
bind-key -n C-j select-pane -D
bind-key -n C-h select-pane -L
bind-key -n C-t new-window
bind-key Tab next-window
bind-key -n C-Tab next-window
bind-key -n C-S-Tab previous-window
bind v split-window -h
bind b split-window
bind T source-file "$HOME/.tmux.conf" \; display-message "Reloaded $HOME/.tmux.conf"
bind O display-message "#(tmux-save-buffer '#S')"
bind D attach-session -t . -c '#{pane_current_path}' \; display-message "Set session path to #{pane_current_path}"
bind H set -s status
bind -n C-l select-pane -R
bind -n C-k select-pane -U
bind -n C-j select-pane -D
bind -n C-h select-pane -L
bind -n C-t new-window
bind Tab next-window
bind -n C-Tab next-window
bind -n C-S-Tab previous-window
bind s run "tmux split-window -l 12 'tmuxswitcher'"
bind M-l source-file "$XDG_CONFIG_HOME/tmux/layouts/dev.tmux"
set -g update-environment "WAYLAND_DISPLAY DISPLAY"
# TODO: check if kitty is installed?
set -g default-terminal "kitty"
set -g mouse on
set -g escape-time 0
@ -26,7 +30,7 @@ set -g monitor-activity on
set -g visual-bell on
set -g bell-action other
set -g mode-keys vi
set -g history-limit 102400000
set -g history-limit 1024000
set -g status on
set -g status-position bottom
set -g status-bg colour0
@ -35,12 +39,16 @@ set -g status-interval 5
set -g status-left-length 50
set -g window-status-style "fg=colour8 bg=colour0"
set -g window-status-current-style "fg=colour8 bg=colour0"
set -g window-status-format " #I"
set -g window-status-format " #W"
set -g window-status-separator ""
set -g window-status-current-format " #I"
set -g status-left "#h:#S #I"
set -g window-status-current-format " #W"
set -g status-left "#h:#S #W"
set -g status-right-length 280
set -g status-right "#(kubeline && printf ' ')#{pane_current_path} #(cd '#{pane_current_path}' && git rev-parse --abbrev-ref --sq HEAD | tr -d \"'\")#{pane_current_command}"
set -g status-right "#(kubeline && printf ' ')"
set -ag status-right "#(pwd | $XDG_CONFIG_HOME/lytedev-dotfiles/common/bin/glancepath) "
set -ag status-right "#(cd '#{pane_current_path}' && git rev-parse --abbrev-ref --sq HEAD | tr -d \"'\")"
set -ag status-right "#{pane_current_command}"
set -g message-style "fg=colour7 bg=colour18"
set -g pane-active-border-style bg=black,fg=blue
set -g pane-border-style bg=black,fg=colour18
@ -52,26 +60,27 @@ set -g window-status-current-format ""
# present a menu of urls to open from the visible pane
# TODO: fzf-ify this
bind-key u capture-pane \;\
save-buffer /tmp/tmux-buffer \;\
split-window -l 10 "urlscan /tmp/tmux-buffer"
# bind u capture-pane \;\
# save-buffer /tmp/tmux-buffer \;\
# split-window -l 10 "urlscan /tmp/tmux-buffer"
bind-key -T copy-mode-vi "y" send-keys -X copy-pipe-and-cancel 'wl-copy'
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel 'wl-copy'; \
bind -T copy-mode-vi "y" send-keys -X copy-pipe-no-clear 'wl-copy' \; display-message 'Copied to clipboard!'
bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-no-clear 'wl-copy' \; display-message 'Copied to clipboard!'
bind-key K kill-pane
bind-key C-S-k kill-window
bind K kill-pane
bind C-S-k kill-window
# attempt at integrating nested tmux sessions nicely
# bind -T root F12 \
# set prefix None \;\
# set key-table off \;\
# set status off \
# if -F "#{pane_in_mode}" "send-keys -X cancel" \;\
# refresh-client -S \;\
# TODO: handle tmux nesting by being able to toggle the prefix (and indicate in status bar?)
# bind -T off F12 \
# set -u prefix \;\
# set -u key-table \;\
# set status on \;\
# refresh-client -S
# TODO: styles after `set -u key-table`
#if -F '#{pane_in_mode}' 'send-keys -X cancel' \;\
bind -T root F12 set -g prefix None \; set -g key-table off \; display-message "Keys OFF" \; refresh-client -S
# TODO: styles after `set -u key-table`
bind -T off F12 \
set -g -u prefix \;\
set -g -u key-table \;\
display-message "Keys ON" \;\
refresh-client -S
source-file "$ENV_PATH/*/tmux.d.conf"

View file

@ -0,0 +1,25 @@
local w = require 'wezterm'
return {
color_schemes = {
["Donokai"] = {
background = "#111111",
foreground = "#ffffff",
cursor_bg = "#333333",
cursor_fg = "#ffffff",
cursor_border = "#666666",
selection_fg = "black",
selection_bg = "cyan",
ansi = {"#111111", "#f92672", "#a6e22e", "#f4bf75", "#ae81ff", "#fd971f", "#a1efe4", "#888888"},
brights = {"#333333", "#f92672", "#a6e22e", "#f4bf75", "#ae81ff", "#fd971f", "#a1efe4", "#888888"},
-- ansi = {"black", "maroon", "green", "olive", "navy", "purple", "teal", "silver"},
-- brights = {"grey", "red", "lime", "yellow", "blue", "fuchsia", "aqua", "white"},
}
},
color_scheme = "Donokai",
colors = {
},
font = w.font("Iosevka"),
font_size = 14,
enable_wayland = true,
}

View file

@ -1,3 +1,4 @@
#!/usr/bin/env sh
sudo efibootmgr -n 0000
# use `efibootmgr` to list boot entries
sudo efibootmgr -n 0002
sudo reboot

View file

@ -1 +0,0 @@
/home/daniel/.home/.config/lytedev-dotfiles/host/desktop

View file

@ -0,0 +1,9 @@
#main-window[tabsintitlebar="true"]:not([extradragspace="true"])
#TabsToolbar
> .toolbar-items {
opacity: 0;
pointer-events: none;
}
#main-window:not([tabsintitlebar="true"]) #TabsToolbar {
visibility: collapse !important;
}

0
host/desktop/tmux.d.conf Normal file
View file

View file

@ -1,2 +1,2 @@
set e $argv[1]
set -Ua fish_user_paths $e/bin
set -gxa fish_user_paths $e/bin

View file

@ -1,4 +1,5 @@
exec libinput-gestures -c $DOTFILES_PATH/os/linux/libinput/sway-gestures.conf
exec swayidle -w timeout 300 'swaylock -f -c 000000' timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' before-sleep 'swaylock -f -c 000000'
bindswitch lid:toggle exec swaylock

View file

@ -0,0 +1 @@
</body>

View file

@ -0,0 +1,60 @@
<!doctype html>
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<style>
*, *::before, *::after {
margin: 0;
padding: 0;
box-sizing: border-box;
}
@font-face {
font-family: 'IosevkaLyte';
font-display: swap;
font-weight: 400;
font-stretch: normal;
font-style: normal;
src: url('https://files.lyte.dev/iosevkalyte/woff2/iosevkalyte-regular.woff2') format('woff2'), url('https://files.lyte.dev/iosevkalyte/ttf/iosevkalyte-regular.ttf') format('truetype');
}
@media (prefers-color-scheme: dark) {
html {
color: #fff;
background-color: #111;
}
a {
color: #0af;
}
a:visited {
color: #faf;
}
}
html {
font-family: IosevkaLyte;
}
pre, code {
font: inherit;
}
a {
display: inline-block;
padding: 0.15em 0;
}
hr {
display: none;
}
h1, pre {
display: block;
max-width: 800px;
margin: 0.5em auto;
}
</style>
</head>
<body>

View file

@ -0,0 +1,11 @@
#!/usr/bin/env fish
set me (status -f)
set dfp $argv[1]
set h $argv[2]
set c $argv[3]
pushd (dirname $me)
sudo ln -s (pwd)/user-public-http.conf /etc/nginx/user-public-http.conf
sudo ln -s (pwd)/user-public-server.conf /etc/nginx/user-public-server.conf
sudo ln -s (pwd)/.nginx-autoindex-before.html /usr/share/nginx/html/.nginx-autoindex-before.html
sudo ln -s (pwd)/.nginx-autoindex-after.html /usr/share/nginx/html/.nginx-autoindex-after.html

View file

@ -0,0 +1,13 @@
disable_symlinks off;
# for wasm games
types {
application/octet-stream clr;
application/octet-stream pdb;
}
gzip on;
gzip_min_length 10240;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/json application/xml application/wasm;
gzip_disable msie6;

View file

@ -0,0 +1,13 @@
# need CORS?
# location ~* \.(eot|ttf|woff|woff2)$ {
# add_header Access-Control-Allow-Origin *;
# }
location ~ ^/~(.+?)(/.*)?$ {
disable_symlinks off;
alias /home/$1/public$2;
index index.html index.htm;
autoindex on;
add_before_body "/.nginx-autoindex-before.html";
add_after_body "/.nginx-autoindex-after.html";
}

View file

@ -0,0 +1,8 @@
#!/usr/bin/env fish
set me (status -f)
set dfp $argv[1]
set h $argv[2]
set c $argv[3]
pushd (dirname $me)
# l app $c/app

Some files were not shown because too many files have changed in this diff Show more