Improve loading of fzf completions
This commit is contained in:
parent
95153292ea
commit
a2bf3fc412
3 changed files with 10 additions and 14 deletions
14
sheldon.toml
14
sheldon.toml
|
|
@ -43,6 +43,15 @@ local = "~/.zsh/plugins"
|
||||||
local = "~/.zsh/plugins"
|
local = "~/.zsh/plugins"
|
||||||
apply = ["defer"]
|
apply = ["defer"]
|
||||||
|
|
||||||
|
[plugins.fzf]
|
||||||
|
github = "junegunn/fzf"
|
||||||
|
use = ["shell/completion.zsh", "shell/key-bindings.zsh"]
|
||||||
|
apply = ["defer"]
|
||||||
|
|
||||||
|
[plugins.fzf-completions]
|
||||||
|
local = "~/.zsh/plugins"
|
||||||
|
apply = ["defer"]
|
||||||
|
|
||||||
[plugins.zsh-syntax-highlighting]
|
[plugins.zsh-syntax-highlighting]
|
||||||
github = "zsh-users/zsh-syntax-highlighting"
|
github = "zsh-users/zsh-syntax-highlighting"
|
||||||
apply = ["defer"]
|
apply = ["defer"]
|
||||||
|
|
@ -81,11 +90,6 @@ apply = ["defer"]
|
||||||
local = "~/.zsh/plugins"
|
local = "~/.zsh/plugins"
|
||||||
apply = ["defer"]
|
apply = ["defer"]
|
||||||
|
|
||||||
[plugins.fzf]
|
|
||||||
local = "~/.zsh/plugins"
|
|
||||||
apply = ["defer"]
|
|
||||||
hooks.pre = "export FZF_COMPLETION_TRIGGER='~~'"
|
|
||||||
|
|
||||||
# This works best if it is placed last.
|
# This works best if it is placed last.
|
||||||
[plugins.compinit]
|
[plugins.compinit]
|
||||||
local = "~/.zsh/plugins"
|
local = "~/.zsh/plugins"
|
||||||
|
|
|
||||||
12
zsh/plugins/fzf-completions.plugin.zsh
Normal file
12
zsh/plugins/fzf-completions.plugin.zsh
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
|
||||||
|
# cURL completions copied from https://blog.revathskumar.com/2024/02/curl-fuzzy-search-options-using-fzf.html
|
||||||
|
_fzf_complete_curl() {
|
||||||
|
_fzf_complete --header-lines=1 --prompt="curl> " -- "$@" < <(
|
||||||
|
curl -h all
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
_fzf_complete_curl_post() {
|
||||||
|
awk '{print $1}' | cut -d ',' -f -1
|
||||||
|
}
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
#!/usr/bin/env zsh
|
|
||||||
|
|
||||||
# Setup fzf completions
|
|
||||||
if (( ${+commands[fzf]} )); then
|
|
||||||
eval "$(fzf --zsh)"
|
|
||||||
fi
|
|
||||||
Loading…
Reference in a new issue