From 79796f0652abad452413d9a4c9e12551d043dd52 Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Thu, 11 Jan 2024 14:20:39 -0500 Subject: [PATCH] [zsh] Add fzf to zsh --- zsh/.fzf.zsh | 16 ++++++++++++++++ zsh/.zshrc | 4 +++- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 zsh/.fzf.zsh diff --git a/zsh/.fzf.zsh b/zsh/.fzf.zsh new file mode 100644 index 0000000..d94d8cb --- /dev/null +++ b/zsh/.fzf.zsh @@ -0,0 +1,16 @@ +#!/usr/bin/env zsh + + +# Setup fzf +# --------- +if [[ ! "$PATH" == */opt/homebrew/opt/fzf/bin* ]]; then + PATH="${PATH:+${PATH}:}/opt/homebrew/opt/fzf/bin" +fi + +# Auto-completion +# --------------- +source "/opt/homebrew/opt/fzf/shell/completion.zsh" + +# Key bindings +# ------------ +source "/opt/homebrew/opt/fzf/shell/key-bindings.zsh" diff --git a/zsh/.zshrc b/zsh/.zshrc index 3074d3f..144ca12 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -5,7 +5,7 @@ export ZSH="$HOME/.oh-my-zsh" ZSH_THEME="robbyrussell" -plugins=(git z asdf direnv emacs yarn) +plugins=(git z fzf asdf direnv emacs yarn) source $ZSH/oh-my-zsh.sh @@ -13,3 +13,5 @@ source $ZSH/oh-my-zsh.sh # Example aliases alias dj="poetry run python manage.py $argv" alias sysu="systemctl --user $argv" + +[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh