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
|
||||
CACHE_MAX_AGE=300
|
||||
MRU_SIZE=20
|
||||
MRU_SIZE=5
|
||||
|
||||
# Debug logging (set DEBUG=1 to enable via environment variable)
|
||||
DEBUG="${DEBUG:-0}"
|
||||
|
|
@ -114,18 +114,23 @@ sort_by_mru() {
|
|||
local all_repos="$1"
|
||||
local mru_list
|
||||
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
|
||||
echo "$mru_list" | sed 's/^/⭐ /'
|
||||
|
||||
# Output non-MRU items using comm (fast set difference)
|
||||
temp_file=$(mktemp)
|
||||
echo "$all_repos" | sort >"$temp_file.all"
|
||||
echo "$mru_list" | sort >"$temp_file.mru"
|
||||
comm -23 "$temp_file.all" "$temp_file.mru" 2>/dev/null || cat "$temp_file.all"
|
||||
|
||||
rm -f "$temp_file.all" "$temp_file.mru"
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ exec {
|
|||
$term --class="uy.com.mzunino"
|
||||
zen-twilight
|
||||
thunderbird
|
||||
obsidian
|
||||
# obsidian
|
||||
vesktop
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,25 +1,21 @@
|
|||
# Lazy load mise activation (only initialize when mise is actually called)
|
||||
# This saves ~50-100ms on every shell startup
|
||||
mise() {
|
||||
# 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)"
|
||||
else
|
||||
# Install mise if missing
|
||||
echo "Installing mise..."
|
||||
mkdir -p ~/.local/bin
|
||||
curl -s https://mise.jdx.dev/mise-latest-linux-x64 > ~/.local/bin/mise
|
||||
chmod +x ~/.local/bin/mise
|
||||
~/.local/bin/mise install
|
||||
eval "$(~/.local/bin/mise activate zsh)"
|
||||
fi
|
||||
# Set up completion after mise is initialized
|
||||
compdef _mise mise 2>/dev/null
|
||||
fi
|
||||
command mise "$@"
|
||||
}
|
||||
# Activate mise during shell initialization for automatic toolchain switching
|
||||
# This enables mise to automatically change toolchains when entering directories
|
||||
if [[ -f ~/.local/bin/mise ]]; then
|
||||
eval "$(~/.local/bin/mise activate zsh)"
|
||||
elif command -v mise >/dev/null 2>&1; then
|
||||
eval "$(mise activate zsh)"
|
||||
else
|
||||
# Install mise if missing
|
||||
echo "Installing mise..."
|
||||
mkdir -p ~/.local/bin
|
||||
curl -s https://mise.jdx.dev/mise-latest-linux-x64 > ~/.local/bin/mise
|
||||
chmod +x ~/.local/bin/mise
|
||||
~/.local/bin/mise install
|
||||
eval "$(~/.local/bin/mise activate zsh)"
|
||||
fi
|
||||
|
||||
# Set up completion after mise is initialized
|
||||
compdef _mise mise 2>/dev/null
|
||||
|
||||
#compdef mise
|
||||
local curcontext="$curcontext"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue