-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
64996a1
commit e018943
Showing
2 changed files
with
56 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/env zsh | ||
|
||
# rose-pine colorscheme | ||
export FZF_DEFAULT_OPTS=" | ||
--color=fg:#908caa,bg:#232136,hl:#ea9a97 | ||
--color=fg+:#e0def4,bg+:#393552,hl+:#ea9a97 | ||
--color=border:#44415a,header:#3e8fb0,gutter:#232136 | ||
--color=spinner:#f6c177,info:#9ccfd8,separator:#44415a | ||
--color=pointer:#c4a7e7,marker:#eb6f92,prompt:#908caa" | ||
|
||
# -- Use fd instead of fzf -- | ||
|
||
export FZF_DEFAULT_COMMAND="fd --hidden --strip-cwd-prefix --exclude .git" | ||
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" | ||
export FZF_ALT_C_COMMAND="fd --type=d --hidden --strip-cwd-prefix --exclude .git" | ||
|
||
export FZF_CTRL_T_OPTS="--preview 'bat -n --color=always --line-range :500 {}'" | ||
export FZF_ALT_C_OPTS="--preview 'exa --tree --color=always {} | head -200'" | ||
|
||
# Advanced customization of fzf options via _fzf_comprun function | ||
# - The first argument to the function is the name of the command. | ||
# - You should make sure to pass the rest of the arguments to fzf. | ||
_fzf_comprun() { | ||
local command=$1 | ||
shift | ||
|
||
case "$command" in | ||
cd) fzf --preview 'exa --tree --color=always {} | head -200' "$@" ;; | ||
export|unset) fzf --preview "eval 'echo $'{}" "$@" ;; | ||
ssh) fzf --preview 'dig {}' "$@" ;; | ||
*) fzf --preview "bat -n --color=always --line-range :500 {}" "$@" ;; | ||
esac | ||
} | ||
|
||
# Use fd (https://github.com/sharkdp/fd) for listing path candidates. | ||
# - The first argument to the function ($1) is the base path to start traversal | ||
# - See the source code (completion.{bash,zsh}) for the details. | ||
_fzf_compgen_path() { | ||
fd --hidden --exclude .git . "$1" | ||
} | ||
|
||
# Use fd to generate the list for directory completion | ||
_fzf_compgen_dir() { | ||
fd --type=d --hidden --exclude .git . "$1" | ||
} |