diff --git a/.zshrc b/.zshrc index 5d07b4d..b3b018e 100644 --- a/.zshrc +++ b/.zshrc @@ -76,7 +76,7 @@ typeset -gaU chpwd_functions chpwd_functions+=fre_chpwd _cwd_gitroot() { - _gitroot=$(git rev-parse --show-toplevel 2>/dev/null || pwd) + _gitroot=$(git rev-parse --show-toplevel 2>/dev/null || sl root 2>/dev/null || pwd) _dir=$((echo "$_gitroot" && fd -td . "$_gitroot") | fzf-tmux -p 90%,40% -y 0) [ -n "$_dir" ] && cd $_dir zle && zle redraw-prompt diff --git a/bin/tmux-edit-helper b/bin/tmux-edit-helper index 6a3644e..e27382b 100755 --- a/bin/tmux-edit-helper +++ b/bin/tmux-edit-helper @@ -5,9 +5,9 @@ if [ -n "$1" ]; then _file=$(readlink -f "$@") else FZF=${FZF:-"fzf-tmux -p 90%,50% -y 0"} - _git_root=$(git rev-parse --show-toplevel 2>/dev/null || pwd) + _git_root=$(git rev-parse --show-toplevel 2>/dev/null || sl root 2>/dev/null || pwd) _store=$(echo "$_git_root" | sha1sum | cut -d ' ' -f 1) - _file=$( (fre --store_name "$_store" --sorted && fd --type f --hidden --follow --exclude .git . "$_git_root") | cat -n | sort -k2 -k1n | uniq -f1 | sort -nk1,1 | cut -f2- | $FZF --no-sort) + _file=$( (fre --store_name "$_store" --sorted && fd --type f --hidden --follow --exclude .git --exclude .sl --ignore-file "${_git_root}/.gitignore" . "$_git_root") | cat -n | sort -k2 -k1n | uniq -f1 | sort -nk1,1 | cut -f2- | $FZF --no-sort) fre --store_name "$_store" --add "$_file" fi