mirror of https://github.com/Chizi123/Dotfiles.git

Joel Grunbaum
2021-12-08 6335fb5dd1bcc0c8b10501983e56ce68872b2217
zsh/.zshrc
@@ -1,6 +1,15 @@
# Enable colors and change prompt
autoload -U colors && colors   # Load colors
PS1="%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%1~%{$fg[red]%}]%{$reset_color%}$%b "
PS1="%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%1~%{$fg[red]%}]%(?:%{$fg[white]%}$:%{$fs_bold[red]%}<%?>$)%{$reset_color%}%b "
# Git prompt
autoload -Uz vcs_info
precmd_vcs_info() { vcs_info }
precmd_functions+=( precmd_vcs_info )
setopt prompt_subst
RPROMPT=\$vcs_info_msg_0_
zstyle ':vcs_info:git:*' formats "%F{240}git:(%b)"
zstyle ':vcs_info:*' enable git
# History files
HISTFILE=~/.zsh_history
@@ -8,13 +17,15 @@
SAVEHIST=10000
# ZSH options
setopt autocd extendedglob # Automatically cd without cd and expand globs
setopt autocd extendedglob correct_all # Automatically cd without cd and expand globs
unsetopt beep notify # Turn off terminal beeps
bindkey -e #Emacs mode
# common aliases
# common shell options
source ~/.commonshell
source /usr/share/doc/pkgfile/command-not-found.zsh
# Command not found. Works with pkgfile in Arch
[ -f /usr/share/doc/pkgfile/command-not-found.zsh ] && source /usr/share/doc/pkgfile/command-not-found.zsh
# Make the delete key work normally
bindkey '^[[3~' delete-char
@@ -42,16 +53,16 @@
autoload -Uz compinit
compinit
# Syntax highlighing
if [[ -f /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ]]; then
   source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
fi
# Plugins with antigen
if [ -f ~/.zsh/antigen/bin/antigen.zsh ]; then
    ADOTDIR=~/.zsh
    _ANTIGEN_INSTALL_DIR=~/.zsh/antigen
    # ANTIGEN_LOG=~/log
    source ~/.zsh/antigen/bin/antigen.zsh
# Git prompt
autoload -Uz vcs_info
precmd_vcs_info() { vcs_info }
precmd_functions+=( precmd_vcs_info )
setopt prompt_subst
RPROMPT=\$vcs_info_msg_0_
zstyle ':vcs_info:git:*' formats "%F{240}git:(%b)" #'%F{240}(%b)%r%f'
zstyle ':vcs_info:*' enable git
    antigen bundle zsh-users/zsh-syntax-highlighting
    antigen bundle zsh-users/zsh-autosuggestions
    antigen bundle zsh-users/zsh-completions
    antigen apply
fi