mirror of
https://gitlab.com/mlunax/dotfiles.git
synced 2025-04-12 05:40:17 +00:00
support more fzf commands
This commit is contained in:
parent
b26e0d10e4
commit
c01c5fdd29
1 changed files with 15 additions and 0 deletions
15
.zshrc
15
.zshrc
|
@ -171,6 +171,21 @@ bindkey '^xe' edit-command-line
|
|||
|
||||
if iscmd fzf; then
|
||||
source <(fzf --zsh);
|
||||
export FZF_CTRL_R_OPTS="
|
||||
--preview 'echo {}' --preview-window up:3:hidden:wrap
|
||||
--bind 'ctrl-/:toggle-preview'
|
||||
--bind 'ctrl-y:execute-silent(echo -n {2..} | pbcopy)+abort'
|
||||
--color header:italic
|
||||
--header 'Press CTRL-Y to copy command into clipboard'"
|
||||
# Preview file content using bat (https://github.com/sharkdp/bat)
|
||||
export FZF_CTRL_T_OPTS="
|
||||
--walker-skip .git,node_modules,target
|
||||
--preview 'bat -n --color=always {}'
|
||||
--bind 'ctrl-/:change-preview-window(down|hidden|)'"
|
||||
# Print tree structure in the preview window
|
||||
export FZF_ALT_C_OPTS="
|
||||
--walker-skip .git,node_modules,target
|
||||
--preview 'tree -C {}'"
|
||||
fi
|
||||
|
||||
if iscmd zoxide; then
|
||||
|
|
Loading…
Add table
Reference in a new issue