From 340c48ca35a95b4f0c965781c9d2c050fa8dd4c3 Mon Sep 17 00:00:00 2001 From: Stefan Herold <794372+Blackjacx@users.noreply.github.com> Date: Mon, 13 Nov 2023 11:42:42 +0100 Subject: [PATCH] Adding zsh-autosuggestion plugin via bootstrap config --- bootstrap/bootstrap.sh | 16 +++++++++++----- bootstrap/dotfiles/.zshrc | 27 ++++++++++++++++++++------- 2 files changed, 31 insertions(+), 12 deletions(-) diff --git a/bootstrap/bootstrap.sh b/bootstrap/bootstrap.sh index fc89871..4e63214 100755 --- a/bootstrap/bootstrap.sh +++ b/bootstrap/bootstrap.sh @@ -232,7 +232,7 @@ configureSoftware() { printf "#################################################################\n\n" command -v bat > /dev/null 2>&1 && { - printf "Install Catppuccin for Bat\n" + printf "Install 'Catppuccin' theme for Bat\n" tmp=$(mktemp -d) git clone git@github.com:catppuccin/bat.git "$tmp" @@ -242,10 +242,16 @@ configureSoftware() { printf 'Preview themes using `bat --list-themes | fzf --preview="bat --theme={} --color=always "`\n' } - fzf_tab_dir="${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/fzf-tab" - if [ ! -d "${HOME}/.oh-my-zsh" ]; then - printf "Install `fzf-tab` ZSH plugin\n" - git clone https://github.com/Aloxaf/fzf-tab "$fzf_tab_dir" + plugin_dir="${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/fzf-tab" + if [[ ! -d $plugin_dir ]]; then + printf "Install 'fzf-tab' ZSH plugin\n" + git clone https://github.com/Aloxaf/fzf-tab "$plugin_dir" + fi + + plugin_dir="${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh_autosuggestions" + if [[ ! -d "$plugin_dir" ]]; then + printf "Install 'zsh_autosuggestions' ZSH plugin\n" + git clone https://github.com/zsh-users/zsh-autosuggestions "$plugin_dir" fi } diff --git a/bootstrap/dotfiles/.zshrc b/bootstrap/dotfiles/.zshrc index b5fa150..116b198 100755 --- a/bootstrap/dotfiles/.zshrc +++ b/bootstrap/dotfiles/.zshrc @@ -77,7 +77,19 @@ export DEFAULT_USER=`whoami` # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ # Example format: plugins=(rails git textmate ruby lighthouse) # Add wisely, as too many plugins slow down shell startup. -plugins=(git git-extras swiftpm bundler common-aliases colored-man-pages direnv bgnotify zsh-autosuggestions fzf fzf-tab) +plugins=( + git + git-extras + swiftpm + bundler + common-aliases + colored-man-pages + direnv + bgnotify + zsh-autosuggestions + fzf + fzf-tab +) # User configuration @@ -128,7 +140,7 @@ zstyle ':fzf-tab:complete:exa:*' fzf-preview ' # ignore these commands export HISTORY_IGNORE="(la|ls|ll|cd|pwd|exit|cd ..)" -# increase history to the last 10000 commands +# increase maximum history entry count export HISTSIZE=500000 # The maximum number of lines that are kept in the history file. export SAVEHIST=$HISTSIZE @@ -163,10 +175,11 @@ export EDITOR="nano" # export SSH_KEY_PATH="~/.ssh/dsa_id" #------------------------------------------------------------------------------- -# Set personal aliases, overriding those provided by oh-my-zsh libs, -# plugins, and themes. Aliases can be placed here, though oh-my-zsh -# users are encouraged to define aliases within the ZSH_CUSTOM folder. -# For a full list of active aliases, run `alias`. +# Aliases +# +# Aliases can be placed here, though oh-my-zsh users are encouraged to +# define aliases within the ZSH_CUSTOM folder. For a full list of active +# aliases, run `alias`. #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- @@ -320,4 +333,4 @@ source "${HOMEBREW_DIR_PREFIX}/share/powerlevel10k/powerlevel10k.zsh-theme" eval "$(rbenv init - zsh)" # zoxide -command -v zoxide > /dev/null 2>&1 && eval "$(zoxide init zsh)" +command -v zoxide > /dev/null 2>&1 && eval "$(zoxide init zsh)" \ No newline at end of file