mirror of
https://github.com/edu4rdshl/based.fish.git
synced 2026-07-17 23:24:46 +00:00
Initial commit
This commit is contained in:
commit
28f308e8a3
11 changed files with 240 additions and 0 deletions
22
functions/__based_fzf_popup.fish
Normal file
22
functions/__based_fzf_popup.fish
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
function __based_fzf_popup
|
||||
set -l suggestions (__based)
|
||||
if test (count $suggestions) -gt 0
|
||||
# Run fzf and capture exit status
|
||||
set -l chosen (printf "%s\n" $suggestions | fzf --height 40% --reverse --prompt='Context > ' --query="$prefix" --no-sort --exact)
|
||||
|
||||
if test -n "$chosen"
|
||||
set -l cleaned (string trim -- $chosen)
|
||||
if test -n "$cleaned"
|
||||
commandline -r -- "$cleaned"
|
||||
commandline -f repaint
|
||||
# If BASED_NO_CONFIRMATION is set to a non-zero value, execute the command immediately
|
||||
if set -q BASED_NO_CONFIRMATION; and test "$BASED_NO_CONFIRMATION" != 0
|
||||
commandline -f execute
|
||||
end
|
||||
end
|
||||
else
|
||||
commandline -f repaint
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue