diff options
Diffstat (limited to 'fzf-exec')
| -rw-r--r-- | fzf-exec/README.md | 4 | ||||
| -rwxr-xr-x | fzf-exec/fzf-exec.sh | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/fzf-exec/README.md b/fzf-exec/README.md index 49dc680..bbe2e6d 100644 --- a/fzf-exec/README.md +++ b/fzf-exec/README.md @@ -7,10 +7,10 @@ fzf-exec replaces the tmux command prompt with a vertico-style completion menu f First, clone this repo to a known location, such as `~/.config/tmux/m`. ```sh cd ~/.config/tmux -git clone https://bluedragon1221/tmux-minibuffer m +git clone https://github.com/bluedragon1221/tmux-minibuffer m ``` -Now, you can add a keybinding to launch fzf-exec: +Now, you can add a keybinding to launch `fzf-exec`: ```sh bind-key -T prefix : run-shell "~/.config/tmux/m/minibuffer.sh -h 10 '~/.config/tmux/m/fzf-exec/fzf-exec.sh'" ``` diff --git a/fzf-exec/fzf-exec.sh b/fzf-exec/fzf-exec.sh index 3085831..177e78b 100755 --- a/fzf-exec/fzf-exec.sh +++ b/fzf-exec/fzf-exec.sh @@ -1,4 +1,6 @@ #!/usr/bin/env bash +SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd) + all_cmds() { tmux list-commands -F $'#{command_list_name}#{?command_list_alias,\n#{command_list_alias},}' } @@ -6,7 +8,7 @@ all_cmds() { selected_cmd=$(all_cmds | fzf \ --prompt : \ --bind 'enter:accept-or-print-query,tab:replace-query,alt-backspace:clear-query' \ - --preview "tmux-doc.sh $(printf '{}' | cut -d' ' -f1)" + --preview "$SCRIPT_DIR/tmux-doc.sh $(printf '{}' | cut -d' ' -f1)" ) tmux $(echo "$selected_cmd" | sed "s@~@$HOME@g") |
