Skip to content

Instantly share code, notes, and snippets.

@Brethel
Last active June 11, 2024 13:15
Show Gist options
  • Save Brethel/674ed9bcbf285fdc90de724b7baac7f0 to your computer and use it in GitHub Desktop.
Save Brethel/674ed9bcbf285fdc90de724b7baac7f0 to your computer and use it in GitHub Desktop.
minimal zshrc
# #plugins
# mkdir -p ~/.local/zsh
# git clone https://github.com/zdharma-continuum/fast-syntax-highlighting.git ~/.local/zsh/
# git clone https://github.com/zsh-users/zsh-autosuggestions.git ~/.local/zsh/
# git clone https://github.com/zsh-users/zsh-completions.git ~/.local/zsh/
autoload -Uz promptinit
promptinit
#prompt adam1
prompt adam2
setopt sharehistory
# Use emacs keybindings even if our EDITOR is set to vi
bindkey -e
# Keep 1000 lines of history within the shell and save it to ~/.zsh_history:
HISTSIZE=5000
SAVEHIST=5000
HISTFILE=~/.zsh_history
# History won't save duplicates.
setopt HIST_IGNORE_ALL_DUPS
# History won't show duplicates on search.
setopt HIST_FIND_NO_DUPS
# Use modern completion system
autoload -Uz compinit
compinit
zstyle ':completion:*' auto-description 'specify: %d'
zstyle ':completion:*' completer _expand _complete _correct _approximate
zstyle ':completion:*' format 'Completing %d'
zstyle ':completion:*' group-name ''
zstyle ':completion:*' menu select=2
eval "$(dircolors -b)"
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
zstyle ':completion:*' list-colors ''
zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s
zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=* l:|=*'
zstyle ':completion:*' menu select=long
zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
zstyle ':completion:*' use-compctl false
zstyle ':completion:*' verbose true
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'
zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd'
bindkey "^R" history-incremental-pattern-search-backward
if [[ "${terminfo[kcuu1]}" != "" ]]; then
autoload -U up-line-or-beginning-search
zle -N up-line-or-beginning-search
# Up arrow
bindkey "${terminfo[kcuu1]}" up-line-or-beginning-search
autoload -U down-line-or-beginning-search
zle -N down-line-or-beginning-search
# Down arrow
bindkey "${terminfo[kcud1]}" down-line-or-beginning-search
fi
#
source $HOME/.local/zsh/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh
source $HOME/.local/zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
fpath=($HOME/.local/zsh/zsh-completions/src $fpath)
#
alias ll='exa -laF --color=always'
alias la='exa --group-directories-first --icons --header --color=always -snew -lahF'
alias g=git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment