diff --git a/.config/fish/conf.d/aliases.fish b/.config/fish/conf.d/aliases.fish index 275eb25..3349f69 100644 --- a/.config/fish/conf.d/aliases.fish +++ b/.config/fish/conf.d/aliases.fish @@ -1,4 +1,5 @@ alias e='tmux-edit-helper' +alias eh='tmux-edit-history' alias dotgit='git --work-tree $HOME --git-dir $HOME/.dot_git' alias git='git-branchless wrap --' alias l='bat --wrap=never --pager="less -S"' diff --git a/.tmux.conf b/.tmux.conf index 61cb9e5..606cf3d 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -64,7 +64,8 @@ bind-key / copy-mode \; send-key ? bind-key P 'capture-pane' \; capture-pane -S - \; save-buffer /tmp/tmux \; delete-buffer bind-key -n C-\\ copy-mode \; send -X search-backward " % "\; send -X search-again bind -n M-g display-popup -h '90%' -w '90%' -b rounded -d '#{?pane_path,#{pane_path},#{pane_current_path}}' -E "gitui" -bind -n M-e display-popup -h '40%' -w '90%' -y 0 -b rounded -d '#{?pane_path,#{pane_path},#{pane_current_path}}' -e FZF=fzf -E "~/bin/tmux-edit-helper" +bind -n M-e display-popup -h '50%' -w '90%' -y 0 -b rounded -d '#{?pane_path,#{pane_path},#{pane_current_path}}' -e FZF=fzf -E "~/bin/tmux-edit-helper" +bind -n M-h display-popup -h '50%' -w '90%' -y 0 -b rounded -d '#{?pane_path,#{pane_path},#{pane_current_path}}' -e FZF=fzf -E "~/bin/tmux-edit-history" bind -n M-m display-popup -h '90%' -w '90%' -b rounded -d '#{?pane_path,#{pane_path},#{pane_current_path}}' -E "~/bin/tmux-build-helper" diff --git a/bin/tmux-edit-history b/bin/tmux-edit-history new file mode 100755 index 0000000..0cd4532 --- /dev/null +++ b/bin/tmux-edit-history @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -eo pipefail +_file=$(fre --store_name edit-history --sorted | exec fzf --no-sort) +[ -n "$_file" ] && exec tmux-edit-helper "$_file" diff --git a/bin/tmux-hx-helper b/bin/tmux-hx-helper index a292eb3..393deeb 100755 --- a/bin/tmux-hx-helper +++ b/bin/tmux-hx-helper @@ -1,5 +1,5 @@ #!/usr/bin/env bash -set -exo pipefail +set -eo pipefail eval "$(direnv export bash 2>/dev/null)" @@ -16,6 +16,8 @@ else fre --store_name "$_store" --add "$_file" fi +fre --store_name "edit-history" --add "$_file" + (tmux select-window -t helix && tmux send-keys -t helix Escape && tmux send-keys -t helix ":open ${_file}" Enter) || tmux new-window -t 42 -n helix helix "${_file}" diff --git a/bin/tmux-nvim-helper b/bin/tmux-nvim-helper index 3c89522..033e05b 100755 --- a/bin/tmux-nvim-helper +++ b/bin/tmux-nvim-helper @@ -16,6 +16,8 @@ else fre --store_name "$_store" --add "$_file" fi +fre --store_name "edit-history" --add "$_file" + _nvim_socket="$XDG_RUNTIME_DIR/nvim-persistent.sock" (tmux select-window -t nvim 2>/dev/null && tmux select-pane -t 0) && exec nvim --server "$_nvim_socket" --remote "$_file"