Renamce nvim-edit-fzf -> tmux-edit-helper

This commit is contained in:
Daniel Lundin 2022-07-28 11:12:31 +02:00
parent dacae13daf
commit 704b463b4a
3 changed files with 2 additions and 2 deletions

13
bin/tmux-edit-helper Executable file
View file

@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -fe -o pipefail
if [ -n "$1" ]; then
_file=$(readlink -f "$@")
else
_git_root=$(git rev-parse --show-toplevel 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") | fzf )
fre --store_name "$_store" --add "$_file"
fi
nvim --server "$XDG_RUNTIME_DIR/nvim.sock" --remote "$_file" && tmux select-window -t1