tmux: M-e invokes edit-helper, repeat to replace with edit-history
This commit is contained in:
parent
182abc1ad0
commit
6e27ee2b5f
3 changed files with 7 additions and 7 deletions
|
@ -63,10 +63,10 @@ bind-key -T copy-mode-vi WheelDownPane select-pane \; send-keys -X -N 1 scroll-d
|
|||
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 '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"
|
||||
bind -n M-g display-popup -h '95%' -w '95%' -b rounded -d '#{?pane_path,#{pane_path},#{pane_current_path}}' -E "gitui"
|
||||
bind -n M-e display-popup -h '95%' -w '95%' -y 0 -b rounded -S "fg=#77fecc" -s "fg=#99ccbb" -d '#{?pane_path,#{pane_path},#{pane_current_path}}' -e FZF=fzf -E "~/bin/tmux-edit-helper"
|
||||
bind -n M-h display-popup -h '95%' -w '95%' -y 0 -b rounded -S "fg=#77fecc" -s "fg=#99ccbb" -d '#{?pane_path,#{pane_path},#{pane_current_path}}' -e FZF=fzf -E "~/bin/tmux-edit-history"
|
||||
bind -n M-m display-popup -h '95%' -w '95%' -b rounded -S "fg=#77fecc" -s "fg=#99ccbb" -d '#{?pane_path,#{pane_path},#{pane_current_path}}' -E "~/bin/tmux-build-helper"
|
||||
|
||||
|
||||
setw -g window-status-format ""
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env bash
|
||||
set -eo pipefail
|
||||
_file=$(fre --store_name edit-history --sorted | exec fzf --no-sort)
|
||||
_file=$(fre --store_name edit-history --sorted | exec fzf --no-sort --preview "bat {}" --preview-window=down,70%,wrap,border-top --color=bg+:16,fg+:49,pointer:49 --layout=reverse "--bind=alt-e:become(tmux-edit-helper)")
|
||||
[ -n "$_file" ] && exec tmux-edit-helper "$_file"
|
||||
|
|
|
@ -8,10 +8,10 @@ PATH="$HOME/bin:$PATH"
|
|||
if [ -n "$1" ]; then
|
||||
_file=$(readlink -f "$@")
|
||||
else
|
||||
FZF=${FZF:-"fzf-tmux -p 90%,50% -y 0"}
|
||||
FZF=${FZF:-"fzf-tmux -p 90%,90% -y 0"}
|
||||
_root=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
|
||||
_store=$(echo "$_root" | sha1sum | cut -d ' ' -f 1)
|
||||
_file=$( ( (fre --store_name "$_store" --sorted | xargs -n 100 ls -d 2>/dev/null || true) && fd --type f --hidden --follow --exclude .git --ignore-file "${_root}/.gitignore" . "$_root") | cat -n | sort -k2 -k1n | uniq -f1 | sort -nk1,1 | cut -f2- | sed -e "s#^${_root}/##" | $FZF --no-sort)
|
||||
_file=$( ( (fre --store_name "$_store" --sorted | xargs -n 100 ls -d 2>/dev/null || true) && fd --type f --hidden --follow --exclude .git --ignore-file "${_root}/.gitignore" . "$_root") | cat -n | sort -k2 -k1n | uniq -f1 | sort -nk1,1 | cut -f2- | sed -e "s#^${_root}/##" | $FZF --no-sort --preview "bat {}" --preview-window=bottom,70%,border-top --color=bg+:16,fg+:49,pointer:49 --layout=reverse "--bind=alt-e:become(tmux-edit-history)")
|
||||
_file="${_root}/${_file}"
|
||||
fre --store_name "$_store" --add "$_file"
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue