Setup some fzf completions for cURL
This commit is contained in:
parent
d948597d4e
commit
8b5250bf97
2 changed files with 19 additions and 0 deletions
15
zsh/fzf-completions.zsh
Normal file
15
zsh/fzf-completions.zsh
Normal file
|
@ -0,0 +1,15 @@
|
|||
# fzf completions
|
||||
test -e /opt/homebrew/opt/fzf/shell/completion.zsh && source /opt/homebrew/opt/fzf/shell/completion.zsh
|
||||
test -e /usr/share/fzf/completion.zsh && source /usr/share/fzf/completion.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
|
||||
}
|
|
@ -134,6 +134,10 @@ export BAT_THEME='OneHalfDark'
|
|||
# Source my own functions
|
||||
test -e $HOME/.zsh/functions.zsh && source $HOME/.zsh/functions.zsh
|
||||
|
||||
# Setup fzf completions
|
||||
export FZF_COMPLETION_TRIGGER='~~'
|
||||
test -e $HOME/.zsh/fzf-completions.zsh && source $HOME/.zsh/fzf-completions.zsh
|
||||
|
||||
# Source the iTerm2 shell integration
|
||||
test -e ${HOME}/.iterm2_shell_integration.zsh && source ${HOME}/.iterm2_shell_integration.zsh
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue