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 2188974
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 15 deletions.
23 changes: 15 additions & 8 deletions bootstrap/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -232,20 +232,27 @@ 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)
tmp="$(mktemp -d)"
config_dir="${HOME}/.config/bat"
git clone [email protected]:catppuccin/bat.git "$tmp"
mkdir -p "$(bat --config-dir)/themes"
cp "$tmp/*.tmTheme" "$(bat --config-dir)/themes"
mkdir -p "$config_dir/themes"
cp "$tmp/*.tmTheme" "$config_dir/themes"
bat cache --build
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:-${HOME}/.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:-${HOME}/.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
}

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 2188974

Please sign in to comment.