diff --git a/.zshrc b/.zshrc index 627d925..add0f7e 100644 --- a/.zshrc +++ b/.zshrc @@ -129,7 +129,15 @@ export NVIM_LISTEN_ADDRESS=/tmp/nvimsocket e () { - nvr --nostart --remote $(readlink -f "$@") + if [ -n "$1" ]; then + _file=$(readlink -f "$@") + else + _git_root=$(git rev-parse --show-toplevel) + _store=$(printf $_git_root | sha1sum | cut -d ' ' -f 1) + _file=$( (fre --store_name $_store --sorted && fd --type f --hidden --follow --exclude .git . $_git_root) | fzf-tmux) + fre --store_name $_store --add $_file + fi + nvr --nostart --remote $_file tmux select-window -t1 }