From 64b5e4b21c15b7e4fb49e4fc1398f79e26dff816 Mon Sep 17 00:00:00 2001 From: Michael Housh Date: Wed, 4 Oct 2023 17:02:38 -0400 Subject: [PATCH] Updated tmux-sessionator and added some espanso symbols --- espanso/espanso/match/base.yml | 1 + espanso/espanso/match/symbols.yml | 7 ++++ nvim/m-housh/spell/en.utf-8.add | 6 +++ nvim/m-housh/spell/en.utf-8.add.spl | Bin 105 -> 170 bytes scripts/scripts/tmux-sessionator | 57 ++++++++++++++-------------- 5 files changed, 43 insertions(+), 28 deletions(-) create mode 100644 espanso/espanso/match/symbols.yml diff --git a/espanso/espanso/match/base.yml b/espanso/espanso/match/base.yml index 4588913..b6d491f 100644 --- a/espanso/espanso/match/base.yml +++ b/espanso/espanso/match/base.yml @@ -12,5 +12,6 @@ imports: - "./email.yml" - "./housecallpro.yml" - "./links.yml" + - './symbols.yml' diff --git a/espanso/espanso/match/symbols.yml b/espanso/espanso/match/symbols.yml new file mode 100644 index 0000000..4d7292e --- /dev/null +++ b/espanso/espanso/match/symbols.yml @@ -0,0 +1,7 @@ +matches: + - trigger: ':deg:' + replace: '°' + - trigger: ':cmd:' + replace: '⌘' + - trigger: ':shift:' + replace: '⇧' diff --git a/nvim/m-housh/spell/en.utf-8.add b/nvim/m-housh/spell/en.utf-8.add index 2d394e0..495f41b 100644 --- a/nvim/m-housh/spell/en.utf-8.add +++ b/nvim/m-housh/spell/en.utf-8.add @@ -1,3 +1,9 @@ MeasureQuick Housh sealtite +Subcool +OEM +NEC +AHJ +CFM +Hydronic diff --git a/nvim/m-housh/spell/en.utf-8.add.spl b/nvim/m-housh/spell/en.utf-8.add.spl index ebf2c94a89e37bc61caf83960757d369ff1e0e02..e6cb53719765f343c5344ae6252a82fffd92b56f 100644 GIT binary patch literal 170 zcmY+7F%H5&304Zonv-MnpMinFj5#B>m@%KRl(CpGgOQ18qN5CNB4Z9?31cP@r!q23 HY*z*Vi{}k@ diff --git a/scripts/scripts/tmux-sessionator b/scripts/scripts/tmux-sessionator index 990a64e..d0b67ca 100755 --- a/scripts/scripts/tmux-sessionator +++ b/scripts/scripts/tmux-sessionator @@ -2,44 +2,44 @@ # Adapted from: https://github.com/ThePrimeagen/.dotfiles/blob/master/bin/.local/scripts/tmux-sessionizer -declare -a findPaths=("$HOME") +DEBUG= -function fpath_prepend() { +declare -a paths=() + +function debug_print { + if [ -n "$DEBUG" ]; then + echo "DEBUG: $1" + fi +} + +function path_prepend() { declare arg for arg in "$@"; do - test -d $arg || continue - findPaths=("$arg" "$findPaths") + debug_print "arg: $arg" + # Check that arg is a directory but not a symlink + # Bc on some of my machines ~/projects is a symlink to $REPOS + test -d $arg && ! test -L $arg || continue + paths=($arg $paths) done } +#################### MAIN #################### + if [[ $# -eq 1 ]]; then selected=$1 else + path_prepend "$HOME" \ + "$HOME/projects" \ + "$REPOS/local" \ + $(find $REPOS/github.com -mindepth 1 -maxdepth 1 -type d -print | sort) - fpath_prepend "$REPOS" \ - "$LOCAL_REPOS" \ - "$GHREPOS" \ - "$GHREPOS" - - # Some of my machines, projects is a symlink to $REPOS, so ignore it. - # On other machines, it is local versions of projects, so add it. - if [[ ! -L "$HOME/projects" ]]; then - findPaths+="$HOME/projects" + debug_print "paths: $paths" + if [ -n "$DEBUG" ]; then + debug_print "Exiting because in debug mode." + exit 0 + else + selected=$(find "${(@)paths}" -mindepth 1 -maxdepth 1 -type d | fzf) fi - - if [[ -d "$REPOS/github.com" ]]; then - for dir in $(find "$REPOS/github.com" -mindepth 1 -maxdepth 1 -type d); do - # prepends to the array. - findPaths=($dir $findPaths) - done - fi - - if [[ -d "$REPOS/local" ]]; then - # prepends to the array. - findPaths=("$REPOS/local" $findPaths) - fi - - selected=$(find -L "${(@)findPaths}" -mindepth 1 -maxdepth 1 -type d | fzf) fi if [[ -z $selected ]]; then @@ -54,8 +54,9 @@ if [[ -z $TMUX ]] && [[ -z $tmux_running ]]; then exit 0 fi +# Create a session if it doesn't exist. if ! tmux has-session -t $selected_name 2> /dev/null; then - tmux new-session -ds $selected_name -c $selected_name + tmux new-session -ds $selected_name -c $selected fi tmux switch-client -t $selected_name