Configurando autocomplete e history no zsh
28 Jan 2026 · rogeriolima · linux · 12 visualizações
sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
-
autosuggesions plugin
git clone https://github.com/zsh-users/zsh-autosuggestions.git $ZSH_CUSTOM/plugins/zsh-autosuggestions -
zsh-syntax-highlighting plugin
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting -
zsh-fast-syntax-highlighting plugin
git clone https://github.com/zdharma-continuum/fast-syntax-highlighting.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/fast-syntax-highlighting -
zsh-autocomplete plugin
git clone --depth 1 -- https://github.com/marlonrichert/zsh-autocomplete.git $ZSH_CUSTOM/plugins/zsh-autocomplete
Enable plugins by adding them to .zshrc.
-
Open .zshrc
nvim ~/.zshrc -
Find the line which says
plugins=(git). -
Replace that line with
plugins=(git zsh-autosuggestions zsh-syntax-highlighting fast-syntax-highlighting zsh-autocomplete)
Configure history unique for all zsh sessions.
- Adicionar ao topo do arquivo .zshrc
# =====================================
# History compartilhado
# =====================================
HISTFILE=~/.zsh_history
HISTSIZE=100000
SAVEHIST=100000
setopt SHARE_HISTORY
setopt INC_APPEND_HISTORY
setopt EXTENDED_HISTORY
setopt HIST_IGNORE_DUPS
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_REDUCE_BLANKS
setopt HIST_VERIFY
setopt HIST_EXPIRE_DUPS_FIRST
# =====================================
# Sync history entre terminais
# =====================================
autoload -Uz add-zsh-hook
sync_history() {
fc -R
}
add-zsh-hook precmd sync_history
# =====================================
# Oh My Zsh
# =====================================
export ZSH="$HOME/.oh-my-zsh"
plugins=(
git
zsh-autosuggestions
zsh-syntax-highlighting
history
)
source $ZSH/oh-my-zsh.sh
