Commit 0b30ddb

Eric Bower  ·  2026-06-13 00:31:37 -0400 EDT
parent 2a05a88
chore: moving yash files around
2 files changed,  +27, -23
+24, -3
 1@@ -13,10 +13,13 @@ bindkey --vi-insert '\^F' accept-prediction
 2 sh() { yash --posix "$@"; }
 3 yash() { command yash "$@"; }
 4 
 5-# define some basic variables if missing
 6-: ${PAGER:=less} ${EDITOR:=vi} ${FCEDIT:=${VISUAL:=$EDITOR}}
 7-: ${LOGNAME:=$(logname)} ${HOSTNAME:=$(uname -n)}
 8+if [ "${COLORTERM-}" = "truecolor" ] || [ "${COLORTERM-}" = "24bit" ] || \
 9+  [ "$(tput colors 2>/dev/null || echo 0)" -ge 8 ]; then
10+  ls() { command ls --color=auto "$@"; }
11+  grep() { command grep --color=auto "$@"; }
12+fi
13 
14+: ${LOGNAME:=$(logname)} ${HOSTNAME:=$(uname -n)}
15 # disable confusing treatment of arguments in the echo command
16 : ${ECHO_STYLE:=RAW}
17 
18@@ -110,4 +113,22 @@ if [ "$_tsl" ] && [ "$_fsl" ]; then
19   }
20 fi
21 
22+_update_direnv() {
23+  if ! command -v direnv > /dev/null 2>&1; then
24+    return
25+  fi
26+
27+ eval "$(
28+   direnv export json |
29+   jq -r 'to_entries | .[] |
30+   if .value == null then
31+     @sh "unset \(.key)"
32+   else
33+     @sh "export \(.key)=\(.value)"
34+   end'
35+ )"
36+}
37+_update_direnv
38+YASH_AFTER_CD=("$YASH_AFTER_CD" '_update_direnv')
39+
40 # kak: filetype=sh
+3, -20
 1@@ -1,5 +1,5 @@
 2 if test -e "$HOME/.config/yash/base.sh"; then
 3-  . --autoload --no-alias "$HOME/.config/yash/base.sh"
 4+  . "$HOME/.config/yash/base.sh"
 5 fi
 6 
 7 if test -e "$HOME/.config/yash/private.sh"; then
 8@@ -10,6 +10,7 @@ export PATH="$HOME/.local/bin:/usr/local/go/bin:$HOME/.cargo/bin:$HOME/.npm-pack
 9 export LANG=en_US.UTF-8
10 export EDITOR=kak
11 export VISUAL=kak
12+export PAGER=less
13 export GPG_TTY="$(tty)"
14 export XDG_CONFIG_HOME="$HOME/.config"
15 export VDIRSYNCER_CONFIG="$HOME/.config/vdirsyncer/config"
16@@ -34,26 +35,8 @@ if test -n "${ZMX_SESSION:-}"; then
17   export YASH_PS1="[$ZMX_SESSION] ${YASH_PS1}"
18 fi
19 
20-# if command -v zmx > /dev/null 2>&1; then
21+# if command -v zmx >/dev/null 2>&1; then
22 #   eval "$(zmx completions bash)"
23 # fi
24 
25-_update_direnv() {
26-  if ! command -v direnv > /dev/null 2>&1; then
27-    return
28-  fi
29-
30- eval "$(
31-   direnv export json |
32-   jq -r 'to_entries | .[] |
33-   if .value == null then
34-     @sh "unset \(.key)"
35-   else
36-     @sh "export \(.key)=\(.value)"
37-   end'
38- )"
39-}
40-_update_direnv
41-YASH_AFTER_CD=("$YASH_AFTER_CD" '_update_direnv')
42-
43 # kak: filetype=sh