Skip to content

Commit

Permalink
Adding zsh-autosuggestion plugin via bootstrap config
Browse files Browse the repository at this point in the history
  • Loading branch information
Blackjacx committed Nov 13, 2023
1 parent 85731cb commit e916112
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 12 deletions.
19 changes: 14 additions & 5 deletions bootstrap/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected]:catppuccin/bat.git "$tmp"
Expand All @@ -242,10 +242,19 @@ configureSoftware() {
printf 'Preview themes using `bat --list-themes | fzf --preview="bat --theme={} --color=always <path to file>"`\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"
echo $plugin_dir/..
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"
echo -laFh $plugin_dir/..
echo "${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins"
if [[ ! -d "$plugin_dir" ]]; then
printf "Install 'zsh_autosuggestions' ZSH plugin\n"
git clone https://github.com/zsh-users/zsh-autosuggestions "$plugin_dir"
fi
}

Expand Down
27 changes: 20 additions & 7 deletions bootstrap/dotfiles/.zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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`.
#-------------------------------------------------------------------------------

#-------------------------------------------------------------------------------
Expand Down Expand Up @@ -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)"

0 comments on commit e916112

Please sign in to comment.