@@ -18,6 +18,12 @@ description = "A channel to select from shell aliases"
1818command = " $SHELL -ic 'alias'"
1919output = " {split:=:0}"
2020
21+ [preview ]
22+ command = " $SHELL -ic 'alias' | grep -E '^(alias )?{split:=:0}='"
23+
24+ [ui .preview_panel ]
25+ size = 30
26+
2127```
2228
2329
@@ -246,6 +252,26 @@ output = "{split: :-1}"
246252[preview ]
247253command = " docker image inspect '{split: :-1}' | jq -C"
248254
255+ [keybindings ]
256+ ctrl-r = " actions:run"
257+ ctrl-d = " actions:remove"
258+ ctrl-s = " actions:shell"
259+
260+ [actions .run ]
261+ description = " Run a container from the selected image"
262+ command = " docker run -it '{split: :-1}'"
263+ mode = " execute"
264+
265+ [actions .shell ]
266+ description = " Run a shell in the selected image"
267+ command = " docker run -it '{split: :-1}' /bin/sh"
268+ mode = " execute"
269+
270+ [actions .remove ]
271+ description = " Remove the selected image"
272+ command = " docker rmi '{split: :-1}'"
273+ mode = " execute"
274+
249275```
250276
251277
@@ -271,6 +297,14 @@ command = "fd -t f . $HOME/.config"
271297[preview ]
272298command = " bat -n --color=always '{}'"
273299
300+ [keybindings ]
301+ enter = " actions:edit"
302+
303+ [actions .edit ]
304+ description = " Edit the selected dotfile"
305+ command = " ${EDITOR:-vim} '{}'"
306+ mode = " execute"
307+
274308```
275309
276310
@@ -458,6 +492,32 @@ output = "{split: :0}"
458492[preview ]
459493command = " git show -p --stat --pretty=fuller --color=always '{0}'"
460494
495+ [keybindings ]
496+ enter = " actions:checkout"
497+ ctrl-d = " actions:delete"
498+ ctrl-m = " actions:merge"
499+ ctrl-r = " actions:rebase"
500+
501+ [actions .checkout ]
502+ description = " Checkout the selected branch"
503+ command = " git checkout '{0}'"
504+ mode = " execute"
505+
506+ [actions .delete ]
507+ description = " Delete the selected branch"
508+ command = " git branch -d '{0}'"
509+ mode = " execute"
510+
511+ [actions .merge ]
512+ description = " Merge the selected branch into current branch"
513+ command = " git merge '{0}'"
514+ mode = " execute"
515+
516+ [actions .rebase ]
517+ description = " Rebase current branch onto the selected branch"
518+ command = " git rebase '{0}'"
519+ mode = " execute"
520+
461521```
462522
463523
@@ -483,6 +543,26 @@ command = "git diff --name-only HEAD"
483543[preview ]
484544command = " git diff HEAD --color=always -- '{}'"
485545
546+ [keybindings ]
547+ ctrl-s = " actions:stage"
548+ ctrl-r = " actions:restore"
549+ ctrl-e = " actions:edit"
550+
551+ [actions .stage ]
552+ description = " Stage the selected file"
553+ command = " git add '{}'"
554+ mode = " fork"
555+
556+ [actions .restore ]
557+ description = " Discard changes in the selected file"
558+ command = " git restore '{}'"
559+ mode = " fork"
560+
561+ [actions .edit ]
562+ description = " Open the selected file in editor"
563+ command = " ${EDITOR:-vim} '{}'"
564+ mode = " execute"
565+
486566```
487567
488568
@@ -512,6 +592,26 @@ frecency = false
512592[preview ]
513593command = " git show -p --stat --pretty=fuller --color=always '{strip_ansi|split: :1}' | head -n 1000"
514594
595+ [keybindings ]
596+ ctrl-y = " actions:cherry-pick"
597+ ctrl-r = " actions:revert"
598+ ctrl-o = " actions:checkout"
599+
600+ [actions .cherry-pick ]
601+ description = " Cherry-pick the selected commit"
602+ command = " git cherry-pick '{strip_ansi|split: :1}'"
603+ mode = " execute"
604+
605+ [actions .revert ]
606+ description = " Revert the selected commit"
607+ command = " git revert '{strip_ansi|split: :1}'"
608+ mode = " execute"
609+
610+ [actions .checkout ]
611+ description = " Checkout the selected commit"
612+ command = " git checkout '{strip_ansi|split: :1}'"
613+ mode = " execute"
614+
515615```
516616
517617
@@ -541,6 +641,20 @@ frecency = false
541641[preview ]
542642command = " git show -p --stat --pretty=fuller --color=always '{0|strip_ansi}'"
543643
644+ [keybindings ]
645+ ctrl-o = " actions:checkout"
646+ ctrl-r = " actions:reset"
647+
648+ [actions .checkout ]
649+ description = " Checkout the selected reflog entry"
650+ command = " git checkout '{0|strip_ansi}'"
651+ mode = " execute"
652+
653+ [actions .reset ]
654+ description = " Reset --hard to the selected reflog entry"
655+ command = " git reset --hard '{0|strip_ansi}'"
656+ mode = " execute"
657+
544658```
545659
546660
@@ -570,6 +684,20 @@ display = "{split:/:-1}"
570684[preview ]
571685command = " cd '{}'; git log -n 200 --pretty=medium --all --graph --color"
572686
687+ [keybindings ]
688+ enter = " actions:cd"
689+ ctrl-e = " actions:edit"
690+
691+ [actions .cd ]
692+ description = " Open a new shell in the selected repository"
693+ command = " cd '{}' && $SHELL"
694+ mode = " execute"
695+
696+ [actions .edit ]
697+ description = " Open the repository in editor"
698+ command = " ${EDITOR:-vim} '{}'"
699+ mode = " execute"
700+
573701```
574702
575703
@@ -906,12 +1034,30 @@ command = "ps -p '{split: :0}' -o user,pid,ppid,state,%cpu,%mem,command | fold"
9061034
9071035[keybindings ]
9081036ctrl-k = " actions:kill"
1037+ ctrl-t = " actions:term"
1038+ ctrl-s = " actions:stop"
1039+ ctrl-c = " actions:cont"
9091040
9101041[actions .kill ]
9111042description = " Kill the selected process (SIGKILL)"
9121043command = " kill -9 {split: :0}"
9131044mode = " execute"
9141045
1046+ [actions .term ]
1047+ description = " Terminate the selected process (SIGTERM)"
1048+ command = " kill -15 {split: :0}"
1049+ mode = " execute"
1050+
1051+ [actions .stop ]
1052+ description = " Stop/pause the selected process (SIGSTOP)"
1053+ command = " kill -STOP {split: :0}"
1054+ mode = " fork"
1055+
1056+ [actions .cont ]
1057+ description = " Continue/resume the selected process (SIGCONT)"
1058+ command = " kill -CONT {split: :0}"
1059+ mode = " fork"
1060+
9151061```
9161062
9171063
@@ -964,19 +1110,30 @@ mode = "fork"
9641110A channel to select hosts from your SSH config
9651111
9661112![ tv running the ssh-hosts channel] ( ../../assets/channels/ssh-hosts.png )
967- ** Requirements:** ` grep ` , ` tr ` , ` cut `
1113+ ** Requirements:** ` grep ` , ` tr ` , ` cut ` , ` awk `
9681114
9691115** Code:** * ssh-hosts.toml*
9701116
9711117``` toml
9721118[metadata ]
9731119name = " ssh-hosts"
9741120description = " A channel to select hosts from your SSH config"
975- requirements = [ " grep" , " tr" , " cut" ,]
1121+ requirements = [ " grep" , " tr" , " cut" , " awk " , ]
9761122
9771123[source ]
9781124command = " grep -E '^Host(name)? ' $HOME/.ssh/config | tr -s ' ' | cut -d' ' -f2- | tr ' ' '\n ' | grep -v '^$'"
9791125
1126+ [preview ]
1127+ command = " awk '/^Host / { found=0 } /^Host (.*[[:space:]])?'{}'([[:space:]].*)?$/ { found=1 } found' $HOME/.ssh/config"
1128+
1129+ [keybindings ]
1130+ enter = " actions:connect"
1131+
1132+ [actions .connect ]
1133+ description = " SSH into the selected host"
1134+ command = " ssh '{}'"
1135+ mode = " execute"
1136+
9801137```
9811138
9821139
@@ -997,20 +1154,28 @@ description = "A channel to find and select text from files"
9971154requirements = [ " rg" , " bat" ,]
9981155
9991156[source ]
1000- command = " rg . --no-heading --line-number --colors 'match:fg:white' --colors 'path:fg:blue' --color=always"
1157+ command = [ " rg . --no-heading --line-number --colors 'match:fg:white' --colors 'path:fg:blue' --color=always" , " rg . --no-heading --line-number --hidden --colors 'match:fg:white' --colors 'path:fg:blue' --color=always " ,]
10011158ansi = true
10021159output = " {strip_ansi|split:\\ ::..2}"
10031160
10041161[preview ]
10051162command = " bat -n --color=always '{strip_ansi|split:\\ ::0}'"
10061163offset = " {strip_ansi|split:\\ ::1}"
10071164
1165+ [keybindings ]
1166+ enter = " actions:edit"
1167+
10081168[preview .env ]
10091169BAT_THEME = " ansi"
10101170
10111171[ui .preview_panel ]
10121172header = " {strip_ansi|split:\\ ::..2}"
10131173
1174+ [actions .edit ]
1175+ description = " Open file in editor at line"
1176+ command = " ${EDITOR:-vim} '+{strip_ansi|split:\\ ::1}' '{strip_ansi|split:\\ ::0}'"
1177+ mode = " execute"
1178+
10141179```
10151180
10161181
0 commit comments