diff --git a/aliases b/aliases index 2fc0609..7250b85 100644 --- a/aliases +++ b/aliases @@ -1,5 +1,5 @@ alias e="$EDITOR" alias app="./bin/app" -command -v bat > /dev/null && alias cat="bat" -command -v exa > /dev/null && alias ls="exa" +(( $+commands[bat] )) && alias cat="bat" +(( $+commands[exa] )) && alias ls="exa" diff --git a/vimrc b/vimrc index 32a9d4d..e1775fe 100644 --- a/vimrc +++ b/vimrc @@ -96,6 +96,11 @@ if filereadable(expand("~/.config/nvim/nerdtree.vimrc")) source ~/.config/nvim/nerdtree.vimrc endif +" Projections +if filereadable(expand("~/.config/nvim/projections.vimrc")) + source ~/.config/nvim/projections.vimrc +endif + " Telescope setup if filereadable(expand("~/.config/nvim/telescope.vimrc")) source ~/.config/nvim/telescope.vimrc diff --git a/zshenv b/zshenv index bbf1d3e..38d233b 100644 --- a/zshenv +++ b/zshenv @@ -17,5 +17,10 @@ if (( $+commands[ruby] )); then [[ -d "$gem_bin_path" ]] && path+=("$gem_bin_path") fi +if (( $+commands[fd] )); then + export FZF_DEFAULT_COMMAND="fd --type f" + export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" +fi + # Add RVM to PATH for scripting. Make sure this is the last PATH variable change. [[ -d "$HOME/.rvm/bin" ]] && path+=("$HOME/.rvm/bin") diff --git a/zshrc b/zshrc index 039b5cf..2eabaa3 100644 --- a/zshrc +++ b/zshrc @@ -19,7 +19,7 @@ fi # 1. starship # 2. p10k # 3. manjaro -if [[ -n "$(command -v starship)" ]]; then +if (( $+commands[starship] )); then eval "$(starship init zsh)" else if [[ -s ~/.p10k.zsh ]]; then @@ -38,15 +38,26 @@ if [[ -s /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh ]]; fi # Intelligent and fast autojump -if [[ -n "$(command -v zoxide)" ]]; then +if (( $+commands[zoxide] )); then eval "$(zoxide init zsh)" fi # Cheat my way through the CLI -if [[ -n "$(command -v navi)" ]]; then +if (( $+commands[navi] )); then eval "$(navi widget zsh)" fi +# Use fd for fzf +if (( $+commands[fd] )); then + _fzf_compgen_path() { + fd --hidden --follow --exclude ".git" . "$1" + } + + _fzf_compgen_dir() { + fd --type d --hidden --follow --exclude ".git" . "$1" + } +fi + # Custom aliases if [[ -s ~/.aliases ]]; then source ~/.aliases