annotate dot_config/private_fish/functions/fzf_last_command_output.fish @ 1052:33ed4d4bba1d
feat: add to-fish for bookmarking directories
author |
Zeger Van de Vannet <zeger.van_de_vannet@nokia.com> |
date |
Tue, 23 Jul 2024 16:46:22 +0200 |
parents |
6ab26ddbf78d |
children |
|
rev |
line source |
1038
|
1 function fzf_last_command_output
|
|
2 set cmd (history | fzf --header "Choose the command to rerun.")
|
|
3 if test -n "$cmd"
|
|
4 set result (eval $cmd | fzf -m --header "Choose the line(s) from the repeated command\'s output to paste into the current command-line. (The order matters!)")
|
|
5 if test -n "$result"
|
|
6 commandline -i (string join " " -- $result "") # adds a space after the inserted line output
|
|
7 end
|
|
8 end
|
|
9 commandline -f repaint
|
|
10 end
|