@@ -30,9 +30,62 @@ export ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=5'
30
30
source $( brew --prefix) /share/zsh-autosuggestions/zsh-autosuggestions.zsh
31
31
32
32
# FZF
33
- export FZF_DEFAULT_OPTS= " --bind='ctrl-o:execute(code {})+abort' --layout=reverse --info=inline --preview 'cat {}' --border --margin=1 --padding=1 "
33
+
34
34
[ -f ~ /.fzf.zsh ] && source ~ /.fzf.zsh
35
35
36
+ # --- setup fzf theme ---
37
+ fg=" #CBE0F0"
38
+ bg=" #011628"
39
+ bg_highlight=" #143652"
40
+ purple=" #B388FF"
41
+ blue=" #06BCE4"
42
+ cyan=" #2CF9ED"
43
+
44
+ export FZF_DEFAULT_OPTS=" --color=fg:${fg} ,bg:${bg} ,hl:${purple} ,fg+:${fg} ,bg+:${bg_highlight} ,hl+:${purple} ,info:${blue} ,prompt:${cyan} ,pointer:${cyan} ,marker:${cyan} ,spinner:${cyan} ,header:${cyan} "
45
+
46
+ export FZF_DEFAULT_OPTS=" --info=inline
47
+ --layout=reverse
48
+ --bind='ctrl-o:execute(code {})+abort'
49
+ --color=fg:${fg} ,bg:${bg} ,hl:${purple} ,fg+:${fg} ,bg+:${bg_highlight} ,hl+:${purple} ,info:${blue} ,prompt:${cyan} ,pointer:${cyan} ,marker:${cyan} ,spinner:${cyan} ,header:${cyan} "
50
+
51
+ export FZF_DEFAULT_COMMAND=" fd --hidden --strip-cwd-prefix --exclude .git"
52
+ export FZF_CTRL_T_COMMAND=" $FZF_DEFAULT_COMMAND "
53
+ export FZF_ALT_C_COMMAND=" fd --type=d --hidden --strip-cwd-prefix --exclude .git"
54
+
55
+ # Use fd (https://github.com/sharkdp/fd) for listing path candidates.
56
+ # - The first argument to the function ($1) is the base path to start traversal
57
+ # - See the source code (completion.{bash,zsh}) for the details.
58
+ _fzf_compgen_path () {
59
+ fd --hidden --exclude .git . " $1 "
60
+ }
61
+
62
+ # Use fd to generate the list for directory completion
63
+ _fzf_compgen_dir () {
64
+ fd --type=d --hidden --exclude .git . " $1 "
65
+ }
66
+
67
+ # not yet installed
68
+ # source ~/fzf-git.sh/fzf-git.sh
69
+
70
+ export FZF_CTRL_T_OPTS=" --preview 'bat -n --color=always --line-range :500 {}'"
71
+ export FZF_ALT_C_OPTS=" --preview 'eza --tree --color=always {} | head -200'"
72
+
73
+ # Advanced customization of fzf options via _fzf_comprun function
74
+ # - The first argument to the function is the name of the command.
75
+ # - You should make sure to pass the rest of the arguments to fzf.
76
+ _fzf_comprun () {
77
+ local command=$1
78
+ shift
79
+
80
+ case " $command " in
81
+ cd) fzf --preview ' eza --tree --color=always {} | head -200' " $@ " ;;
82
+ export|unset) fzf --preview " eval 'echo \$ '{}" " $@ " ;;
83
+ ssh) fzf --preview ' dig {}' " $@ " ;;
84
+ * ) fzf --preview " bat -n --color=always --line-range :500 {}" " $@ " ;;
85
+ esac
86
+ }
87
+
88
+
36
89
# zoxide
37
90
eval " $( zoxide init zsh --cmd cd) "
38
91
0 commit comments