fzf -> sk

This commit is contained in:
Daniel Flanagan 2022-12-13 14:12:29 -06:00
parent ee2445d1c5
commit 57a5439bd7
Signed by: lytedev
GPG Key ID: 5B2020A0F9921EF4
14 changed files with 18 additions and 18 deletions

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash
# TODO: needs fixing...?
cd "$(dirname "$(fzf)")" || exit 1
cd "$(dirname "$(sk)")" || exit 1

View File

@ -1,7 +1,7 @@
#!/usr/bin/env fish
has_command fzf || begin
echo "fzf not installed"
has_command sk || begin
echo "sk not installed (skim fuzzy finder)"
exit 1
end
@ -30,7 +30,7 @@ end
cat $DOTFILES_PATH/common/envs |
filter_existing_directory |
fzf --multi \
sk --multi \
--prompt "Select applicable environments (multi-select w/ TAB): " \
--preview-window="up:50%:noborder" \
--preview="ls -la --color=always $DOTFILES_PATH/{}" |

View File

@ -1,5 +1,5 @@
#!/usr/bin/env sh
r="$(< "$HOME/.emoji.txt" fzf --height 40%)"
r="$(< "$HOME/.emoji.txt" sk --height 40%)"
echo "$r" | awk '$0=$1' | tr -d '\n' | clip
echo "Copied $r emoji to your clipboard"

View File

@ -3,13 +3,13 @@
rf="$1" # history count record file
cf="$1" # all choices file
touch "$record"
touch "$LAUNCHER_HISTORY_FILE"
app="$(
< "$rf" awk 'NF{NF--};1' | cat - "$cf" | \
sort | uniq -c | sort -nr | \
sd '^\s+' '' | \
cut -d' ' -f2- | \
fzf
sk
)"
echo "$app $(date +%s)" >> "$LAUNCHER_HISTORY_FILE"
echo "$app"

View File

@ -1,3 +1,3 @@
#!/usr/bin/env fish
fish -c (history | head -n 1 | grep -v history) | fzf
fish -c (history | head -n 1 | grep -v history) | sk

View File

@ -5,5 +5,5 @@ kubectl config get-contexts --no-headers | \
tr -s ' ' | \
sed -E 's/^\*?[[:space:]]*//g' | \
cut -d ' ' -f1 | \
fzf | \
sk | \
xargs -I{} kubectl config use-context '{}'

View File

@ -8,5 +8,5 @@ kubectl get namespaces --show-labels | \
uniq | \
sort | \
cut -d ' ' -f1 | \
fzf | \
sk | \
xargs -I{} kubectl config set-context --current --namespace='{}'

View File

@ -11,7 +11,7 @@ app="$(
sd -fm '^\s+' '' | \
cut -d' ' -f2- | \
grep "\S" | \
fzf
sk
)"
# if no app is selected, just exit
test -z "$app" && exit 1

View File

@ -1,2 +0,0 @@
#!/usr/bin/env sh
env FZFP_HEIGHT="100%" floating-term fish -c "fzfp | head -n 1 | clip &"

View File

@ -1,3 +1,3 @@
#!/usr/bin/env sh
d="$(command ls $ENV_PATH | fzf)" && \
d="$(command ls "$ENV_PATH" | sk)" && \
tmux-lyte-session "env-$d" "$ENV_PATH/$d"

View File

@ -7,12 +7,12 @@ t="tmux switch-client -t"
sess="$({ tmux display-message -p -F "$fmt" && tmux list-sessions -F "$fmt"; } \
| awk '!seen[$1]++' \
| column -t -s'|' \
| fzf -q '$' --reverse --prompt 'switch session: ' -1 --preview "tmux-session-preview {}" \
| sk -q '$' --reverse --prompt 'switch session: ' -1 --preview "tmux-session-preview {}" \
| cut -d':' -f1)"
[ -z "$sess" ] && exit 1
$t $sess
$t "$sess"

View File

@ -155,6 +155,8 @@ alias mount 'sudo -E mount'
alias umount 'sudo -E umount'
alias ip 'ip -color'
alias pt 'pass tessen'
has_command xdg-open && alias open xdg-open
has_command docker && begin
alias dc "docker compose"

View File

@ -58,7 +58,7 @@ set -g pane-base-index 1
set -g window-status-current-format ""
# present a menu of urls to open from the visible pane
# TODO: fzf-ify this
# TODO: fuzzy search this
# bind u capture-pane \;\
# save-buffer /tmp/tmux-buffer \;\
# split-window -l 10 "urlscan /tmp/tmux-buffer"

View File

@ -74,7 +74,7 @@ You will want to symlink relevant environment layers into the `$ENV_PATH` in
order to have your OS-specific applications be configured and common
applications configured for the host OS.
There's a handy `fzf`-based script that makes this super easy (note that you
There's a handy script that makes this super easy (note that you
can select multiple environments with TAB):
```bash