File tree Expand file tree Collapse file tree 3 files changed +22
-1
lines changed
Expand file tree Collapse file tree 3 files changed +22
-1
lines changed Original file line number Diff line number Diff line change 2727 - name : Run Shellcheck
2828 run : |
2929 ./shellcheck --version
30- ./shellcheck -e SC2148 wt completions/*
30+ ./shellcheck -e SC2148 wt completions/_wt_completion completions/wt_completion
Original file line number Diff line number Diff line change @@ -41,6 +41,11 @@ sudo cp completions/_wt_completion <one-of-$fpath>
4141
4242exec zsh
4343```
44+
45+ ** For Fish**
46+ ``` bash
47+ cp completions/wt.fish ~ /.config/fish/completions
48+ ```
4449---
4550Tab autocompletion works for switching between your worktrees.
4651``` bash
Original file line number Diff line number Diff line change 1+ # AUTOCOMPLETION FOR FISH
2+ # Reference: https://fishshell.com/docs/current/completions.html
3+
4+ # wt list: list all the available worktrees
5+ # | awk '{ print $1; }': grab the first column of the output
6+ # | tr "\n" " ": replace line break character with space to put the worktrees on single line
7+ # separated by space
8+
9+ set list (wt list | awk ' { print $1; }' | tr " \n" " " )
10+ set opts " "
11+
12+ for item in (string split " " " $list " )
13+ set -a opts (basename -- " $item " )
14+ end
15+
16+ complete -c wt -f -a " $opts "
You can’t perform that action at this time.
0 commit comments