From 876194e91b44f05ee46f7b26429390bca3f3e1e9 Mon Sep 17 00:00:00 2001 From: Davide Frattarolo Date: Mon, 12 Jan 2026 11:54:10 +0100 Subject: [PATCH] Some adds --- conf.d/pyenv.fish | 7 +++++++ config.fish | 8 +++++++- functions/git-refresh.fish | 26 ++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 conf.d/pyenv.fish create mode 100644 functions/git-refresh.fish diff --git a/conf.d/pyenv.fish b/conf.d/pyenv.fish new file mode 100644 index 0000000..3956ea8 --- /dev/null +++ b/conf.d/pyenv.fish @@ -0,0 +1,7 @@ +set -Ux PYENV_ROOT $HOME/.pyenv +set -U fish_user_paths $PYENV_ROOT/bin $fish_user_paths + +# Load pyenv automatically by appending +# the following to ~/.config/fish/config.fish: + +# Restart your shell for the changes to take effect. diff --git a/config.fish b/config.fish index 2a864cb..02727fb 100644 --- a/config.fish +++ b/config.fish @@ -35,8 +35,10 @@ if status is-interactive set -q KREW_ROOT; and set -gx PATH $PATH $KREW_ROOT/.krew/bin; or set -gx PATH $PATH $HOME/.krew/bin set -U autovenv_enable yes - set -U autovenv_announce no + set -U autovenv_announce yes set -U autovenv_dir .venv + + git-refresh # Check max tmux window in the Home session and open the Home session in a new tmux window # Find max window number in the Home session #if test -z "$TMUX"; @@ -57,3 +59,7 @@ fish_add_path /home/df/.opencode/bin # Added by LM Studio CLI (lms) set -gx PATH $PATH /home/df/.lmstudio/bin # End of LM Studio CLI section + +# bun +set --export BUN_INSTALL "$HOME/.bun" +set --export PATH $BUN_INSTALL/bin $PATH diff --git a/functions/git-refresh.fish b/functions/git-refresh.fish new file mode 100644 index 0000000..fa76bdd --- /dev/null +++ b/functions/git-refresh.fish @@ -0,0 +1,26 @@ +# git-refresh initialization hook +# +# You can use the following variables in this file: +# * $package package name +# * $path package path +# * $dependencies package dependencies + +# Timeout in seconds before allowing another git pull (default: 15 minutes) +set -q GIT_REFRESH_TIMEOUT; or set -g GIT_REFRESH_TIMEOUT 900 + +function git-refresh --on-variable PWD \ + --description "git pull automatically wherever inside a git repository" + test -d .git; or return + + set --local fetch_head .git/FETCH_HEAD + if test -f $fetch_head + set --local age (math (date +%s) - (stat -c %Y $fetch_head 2>/dev/null; or stat -f %m $fetch_head)) + if test $age -lt $GIT_REFRESH_TIMEOUT + echo -e "\e[1m(git-refresh) - Cooldown: "(math $GIT_REFRESH_TIMEOUT - $age)"s remaining\e[0m" + return + end + end + + echo -e "\e[1m(git-refresh) - GIT repo detected\e[0m" + git pull --all --verbose +end