dev: automated commit - 2025-11-18 10:23:16
This commit is contained in:
parent
ba26418a15
commit
dff9e3cd97
3 changed files with 28 additions and 27 deletions
|
|
@ -3,7 +3,7 @@ set -euo pipefail
|
||||||
|
|
||||||
# Configuration
|
# Configuration
|
||||||
CACHE_MAX_AGE=300
|
CACHE_MAX_AGE=300
|
||||||
MRU_SIZE=20
|
MRU_SIZE=5
|
||||||
|
|
||||||
# Debug logging (set DEBUG=1 to enable via environment variable)
|
# Debug logging (set DEBUG=1 to enable via environment variable)
|
||||||
DEBUG="${DEBUG:-0}"
|
DEBUG="${DEBUG:-0}"
|
||||||
|
|
@ -114,18 +114,23 @@ sort_by_mru() {
|
||||||
local all_repos="$1"
|
local all_repos="$1"
|
||||||
local mru_list
|
local mru_list
|
||||||
local temp_file
|
local temp_file
|
||||||
temp_file=$(mktemp)
|
|
||||||
|
|
||||||
[ -f "$MRU_FILE" ] && mru_list=$(cat "$MRU_FILE" | grep -v '^$') || mru_list=""
|
[ -f "$MRU_FILE" ] && mru_list=$(grep -v '^$' "$MRU_FILE") || mru_list=""
|
||||||
|
|
||||||
|
# If MRU list is empty, just return sorted repos
|
||||||
|
if [ -z "$mru_list" ]; then
|
||||||
|
echo "$all_repos" | sort
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
# Output MRU items first with indicator
|
# Output MRU items first with indicator
|
||||||
echo "$mru_list" | sed 's/^/⭐ /'
|
echo "$mru_list" | sed 's/^/⭐ /'
|
||||||
|
|
||||||
# Output non-MRU items using comm (fast set difference)
|
# Output non-MRU items using comm (fast set difference)
|
||||||
|
temp_file=$(mktemp)
|
||||||
echo "$all_repos" | sort >"$temp_file.all"
|
echo "$all_repos" | sort >"$temp_file.all"
|
||||||
echo "$mru_list" | sort >"$temp_file.mru"
|
echo "$mru_list" | sort >"$temp_file.mru"
|
||||||
comm -23 "$temp_file.all" "$temp_file.mru" 2>/dev/null || cat "$temp_file.all"
|
comm -23 "$temp_file.all" "$temp_file.mru" 2>/dev/null || cat "$temp_file.all"
|
||||||
|
|
||||||
rm -f "$temp_file.all" "$temp_file.mru"
|
rm -f "$temp_file.all" "$temp_file.mru"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ exec {
|
||||||
$term --class="uy.com.mzunino"
|
$term --class="uy.com.mzunino"
|
||||||
zen-twilight
|
zen-twilight
|
||||||
thunderbird
|
thunderbird
|
||||||
obsidian
|
# obsidian
|
||||||
vesktop
|
vesktop
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,10 @@
|
||||||
# Lazy load mise activation (only initialize when mise is actually called)
|
# Activate mise during shell initialization for automatic toolchain switching
|
||||||
# This saves ~50-100ms on every shell startup
|
# This enables mise to automatically change toolchains when entering directories
|
||||||
mise() {
|
if [[ -f ~/.local/bin/mise ]]; then
|
||||||
# Initialize mise only once
|
|
||||||
if ! which mise >/dev/null 2>&1; then
|
|
||||||
# Check if mise binary exists
|
|
||||||
if [[ -f ~/.local/bin/mise ]]; then
|
|
||||||
eval "$(~/.local/bin/mise activate zsh)"
|
eval "$(~/.local/bin/mise activate zsh)"
|
||||||
else
|
elif command -v mise >/dev/null 2>&1; then
|
||||||
|
eval "$(mise activate zsh)"
|
||||||
|
else
|
||||||
# Install mise if missing
|
# Install mise if missing
|
||||||
echo "Installing mise..."
|
echo "Installing mise..."
|
||||||
mkdir -p ~/.local/bin
|
mkdir -p ~/.local/bin
|
||||||
|
|
@ -14,12 +12,10 @@ mise() {
|
||||||
chmod +x ~/.local/bin/mise
|
chmod +x ~/.local/bin/mise
|
||||||
~/.local/bin/mise install
|
~/.local/bin/mise install
|
||||||
eval "$(~/.local/bin/mise activate zsh)"
|
eval "$(~/.local/bin/mise activate zsh)"
|
||||||
fi
|
fi
|
||||||
# Set up completion after mise is initialized
|
|
||||||
compdef _mise mise 2>/dev/null
|
# Set up completion after mise is initialized
|
||||||
fi
|
compdef _mise mise 2>/dev/null
|
||||||
command mise "$@"
|
|
||||||
}
|
|
||||||
|
|
||||||
#compdef mise
|
#compdef mise
|
||||||
local curcontext="$curcontext"
|
local curcontext="$curcontext"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue