fzf -> sk
This commit is contained in:
parent
ee2445d1c5
commit
57a5439bd7
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# TODO: needs fixing...?
|
# TODO: needs fixing...?
|
||||||
cd "$(dirname "$(fzf)")" || exit 1
|
cd "$(dirname "$(sk)")" || exit 1
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env fish
|
#!/usr/bin/env fish
|
||||||
|
|
||||||
has_command fzf || begin
|
has_command sk || begin
|
||||||
echo "fzf not installed"
|
echo "sk not installed (skim fuzzy finder)"
|
||||||
exit 1
|
exit 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ end
|
||||||
|
|
||||||
cat $DOTFILES_PATH/common/envs |
|
cat $DOTFILES_PATH/common/envs |
|
||||||
filter_existing_directory |
|
filter_existing_directory |
|
||||||
fzf --multi \
|
sk --multi \
|
||||||
--prompt "Select applicable environments (multi-select w/ TAB): " \
|
--prompt "Select applicable environments (multi-select w/ TAB): " \
|
||||||
--preview-window="up:50%:noborder" \
|
--preview-window="up:50%:noborder" \
|
||||||
--preview="ls -la --color=always $DOTFILES_PATH/{}" |
|
--preview="ls -la --color=always $DOTFILES_PATH/{}" |
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env sh
|
#!/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 "$r" | awk '$0=$1' | tr -d '\n' | clip
|
||||||
echo "Copied $r emoji to your clipboard"
|
echo "Copied $r emoji to your clipboard"
|
|
@ -3,13 +3,13 @@
|
||||||
rf="$1" # history count record file
|
rf="$1" # history count record file
|
||||||
cf="$1" # all choices file
|
cf="$1" # all choices file
|
||||||
|
|
||||||
touch "$record"
|
touch "$LAUNCHER_HISTORY_FILE"
|
||||||
app="$(
|
app="$(
|
||||||
< "$rf" awk 'NF{NF--};1' | cat - "$cf" | \
|
< "$rf" awk 'NF{NF--};1' | cat - "$cf" | \
|
||||||
sort | uniq -c | sort -nr | \
|
sort | uniq -c | sort -nr | \
|
||||||
sd '^\s+' '' | \
|
sd '^\s+' '' | \
|
||||||
cut -d' ' -f2- | \
|
cut -d' ' -f2- | \
|
||||||
fzf
|
sk
|
||||||
)"
|
)"
|
||||||
echo "$app $(date +%s)" >> "$LAUNCHER_HISTORY_FILE"
|
echo "$app $(date +%s)" >> "$LAUNCHER_HISTORY_FILE"
|
||||||
echo "$app"
|
echo "$app"
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
#!/usr/bin/env fish
|
#!/usr/bin/env fish
|
||||||
|
|
||||||
fish -c (history | head -n 1 | grep -v history) | fzf
|
fish -c (history | head -n 1 | grep -v history) | sk
|
||||||
|
|
|
@ -5,5 +5,5 @@ kubectl config get-contexts --no-headers | \
|
||||||
tr -s ' ' | \
|
tr -s ' ' | \
|
||||||
sed -E 's/^\*?[[:space:]]*//g' | \
|
sed -E 's/^\*?[[:space:]]*//g' | \
|
||||||
cut -d ' ' -f1 | \
|
cut -d ' ' -f1 | \
|
||||||
fzf | \
|
sk | \
|
||||||
xargs -I{} kubectl config use-context '{}'
|
xargs -I{} kubectl config use-context '{}'
|
||||||
|
|
|
@ -8,5 +8,5 @@ kubectl get namespaces --show-labels | \
|
||||||
uniq | \
|
uniq | \
|
||||||
sort | \
|
sort | \
|
||||||
cut -d ' ' -f1 | \
|
cut -d ' ' -f1 | \
|
||||||
fzf | \
|
sk | \
|
||||||
xargs -I{} kubectl config set-context --current --namespace='{}'
|
xargs -I{} kubectl config set-context --current --namespace='{}'
|
||||||
|
|
|
@ -11,7 +11,7 @@ app="$(
|
||||||
sd -fm '^\s+' '' | \
|
sd -fm '^\s+' '' | \
|
||||||
cut -d' ' -f2- | \
|
cut -d' ' -f2- | \
|
||||||
grep "\S" | \
|
grep "\S" | \
|
||||||
fzf
|
sk
|
||||||
)"
|
)"
|
||||||
# if no app is selected, just exit
|
# if no app is selected, just exit
|
||||||
test -z "$app" && exit 1
|
test -z "$app" && exit 1
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
#!/usr/bin/env sh
|
|
||||||
env FZFP_HEIGHT="100%" floating-term fish -c "fzfp | head -n 1 | clip &"
|
|
|
@ -1,3 +1,3 @@
|
||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
d="$(command ls $ENV_PATH | fzf)" && \
|
d="$(command ls "$ENV_PATH" | sk)" && \
|
||||||
tmux-lyte-session "env-$d" "$ENV_PATH/$d"
|
tmux-lyte-session "env-$d" "$ENV_PATH/$d"
|
||||||
|
|
|
@ -7,12 +7,12 @@ t="tmux switch-client -t"
|
||||||
sess="$({ tmux display-message -p -F "$fmt" && tmux list-sessions -F "$fmt"; } \
|
sess="$({ tmux display-message -p -F "$fmt" && tmux list-sessions -F "$fmt"; } \
|
||||||
| awk '!seen[$1]++' \
|
| awk '!seen[$1]++' \
|
||||||
| column -t -s'|' \
|
| 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)"
|
| cut -d':' -f1)"
|
||||||
|
|
||||||
[ -z "$sess" ] && exit 1
|
[ -z "$sess" ] && exit 1
|
||||||
|
|
||||||
$t $sess
|
$t "$sess"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -155,6 +155,8 @@ alias mount 'sudo -E mount'
|
||||||
alias umount 'sudo -E umount'
|
alias umount 'sudo -E umount'
|
||||||
alias ip 'ip -color'
|
alias ip 'ip -color'
|
||||||
|
|
||||||
|
alias pt 'pass tessen'
|
||||||
|
|
||||||
has_command xdg-open && alias open xdg-open
|
has_command xdg-open && alias open xdg-open
|
||||||
has_command docker && begin
|
has_command docker && begin
|
||||||
alias dc "docker compose"
|
alias dc "docker compose"
|
||||||
|
|
|
@ -58,7 +58,7 @@ set -g pane-base-index 1
|
||||||
set -g window-status-current-format ""
|
set -g window-status-current-format ""
|
||||||
|
|
||||||
# present a menu of urls to open from the visible pane
|
# present a menu of urls to open from the visible pane
|
||||||
# TODO: fzf-ify this
|
# TODO: fuzzy search this
|
||||||
# bind u capture-pane \;\
|
# bind u capture-pane \;\
|
||||||
# save-buffer /tmp/tmux-buffer \;\
|
# save-buffer /tmp/tmux-buffer \;\
|
||||||
# split-window -l 10 "urlscan /tmp/tmux-buffer"
|
# split-window -l 10 "urlscan /tmp/tmux-buffer"
|
||||||
|
|
|
@ -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
|
order to have your OS-specific applications be configured and common
|
||||||
applications configured for the host OS.
|
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):
|
can select multiple environments with TAB):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|
Reference in a new issue