Feat: fzf, configs and installer

This commit is contained in:
2023-04-27 22:55:01 +03:00
parent a5db6a465e
commit 383855f23a
7 changed files with 35 additions and 8 deletions

1
.gitignore vendored
View File

@@ -4,3 +4,4 @@ Brewfile.lock.json
*cache
.idea
.vscode
config/fzf

View File

@@ -19,3 +19,5 @@ x-load-configs
# Import ssh keys in keychain
ssh-add -A 2>/dev/null;
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.bash ] && source "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.bash

View File

@@ -41,3 +41,5 @@ have antigen && {
# starship is present
have starship && eval "$(starship init zsh)"
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.zsh ] && source "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.zsh

View File

@@ -1,13 +1,13 @@
# Setup fzf
# ---------
if [[ ! "$PATH" == */opt/homebrew/opt/fzf/bin* ]]; then
PATH="${PATH:+${PATH}:}/opt/homebrew/opt/fzf/bin"
if [[ ! "$PATH" == */Users/ivuorinen/.config/fzf/bin* ]]; then
PATH="${PATH:+${PATH}:}/Users/ivuorinen/.config/fzf/bin"
fi
# Auto-completion
# ---------------
[[ $- == *i* ]] && source "/opt/homebrew/opt/fzf/shell/completion.bash" 2> /dev/null
[[ $- == *i* ]] && source "/Users/ivuorinen/.config/fzf/shell/completion.bash" 2> /dev/null
# Key bindings
# ------------
source "/opt/homebrew/opt/fzf/shell/key-bindings.bash"
source "/Users/ivuorinen/.config/fzf/shell/key-bindings.bash"

View File

@@ -1,13 +1,13 @@
# Setup fzf
# ---------
if [[ ! "$PATH" == */opt/homebrew/opt/fzf/bin* ]]; then
PATH="${PATH:+${PATH}:}/opt/homebrew/opt/fzf/bin"
if [[ ! "$PATH" == */Users/ivuorinen/.config/fzf/bin* ]]; then
PATH="${PATH:+${PATH}:}/Users/ivuorinen/.config/fzf/bin"
fi
# Auto-completion
# ---------------
[[ $- == *i* ]] && source "/opt/homebrew/opt/fzf/shell/completion.zsh" 2> /dev/null
[[ $- == *i* ]] && source "/Users/ivuorinen/.config/fzf/shell/completion.zsh" 2> /dev/null
# Key bindings
# ------------
source "/opt/homebrew/opt/fzf/shell/key-bindings.zsh"
source "/Users/ivuorinen/.config/fzf/shell/key-bindings.zsh"

View File

@@ -50,6 +50,7 @@ function section_install
$0 brew install
$0 install composer
$0 install dotenv
$0 install fzf
$0 install gh
$0 install go
$0 install imagick
@@ -73,6 +74,10 @@ function section_install
| sh -s -- -b "$XDG_BIN_HOME" \
&& msg_yay "dotenv-linter installed!"
;;
fzf)
bash "$DOTFILES/scripts/install-fzf.sh" \
&& msg_yay "fzf installed!"
;;
gh)
bash "$DOTFILES/scripts/install-gh-extensions.sh" \
&& msg_yay "github cli extensions installed!"

17
scripts/install-fzf.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/usr/bin/env bash
#
# Install fzf
#
# shellcheck source=shared.sh
source "$HOME/.dotfiles/scripts/shared.sh"
FZF_GIT="https://github.com/junegunn/fzf.git"
FZF_PATH="${XDG_CONFIG_HOME}/fzf"
if [ ! -d "$FZF_PATH" ]; then
git clone --depth 1 "$FZF_GIT" "$FZF_PATH"
$FZF_PATH/install --xdg --all --no-update-rc
else
msg_done "fzf ($FZF_PATH/) already installed"
fi