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

Joel Grunbaum
2020-06-27 91af7f6bbfe6b010ea79106d3865a785daddec31
commit | author | age
a67156 1 # Enable colors and change prompt
J 2 autoload -U colors && colors    # Load colors
91af7f 3 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 "
a67156 4
J 5 # History files
6 HISTFILE=~/.zsh_history
7 HISTSIZE=10000
8 SAVEHIST=10000
9
10 # ZSH options
1c5cae 11 setopt autocd extendedglob correct_all # Automatically cd without cd and expand globs
a67156 12 unsetopt beep notify # Turn off terminal beeps
J 13 bindkey -e #Emacs mode
14
031336 15 # common shell options
a67156 16 source ~/.commonshell
031336 17 [ -f /usr/share/doc/pkgfile/command-not-found.zsh ] && source /usr/share/doc/pkgfile/command-not-found.zsh
a67156 18
J 19 # Make the delete key work normally
20 bindkey '^[[3~' delete-char
21 bindkey '^[3;5~' delete-char
22
23 # Disable ctrl-s to freeze terminal
24 stty stop undef
25
26 # Set terminal title
27 precmd() {print -Pn "\e]0;%n@%M:%~\a"}
28
29 # Completion stuff, generated from the install
30 zstyle ':completion:*' completer _expand _complete _ignored _correct _approximate
31 zstyle ':completion:*' list-colors ''
32 zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s
33 zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}'
34 zstyle ':completion:*' max-errors 3 numeric
35 zstyle ':completion:*' menu select=1
36 zstyle ':completion:*' prompt 'Change to "%e"'
37 zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
38 zstyle ':completion:*' verbose true
39 zstyle ':completion::complete:*' gain-privileges 1
40 zstyle :compinstall filename '/home/joel/.zshrc'
41
42 autoload -Uz compinit
43 compinit
44
45 # Syntax highlighing
46 if [[ -f /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ]]; then
47     source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
48 fi
49
50 # Git prompt
51 autoload -Uz vcs_info
52 precmd_vcs_info() { vcs_info }
53 precmd_functions+=( precmd_vcs_info )
54 setopt prompt_subst
55 RPROMPT=\$vcs_info_msg_0_
56 zstyle ':vcs_info:git:*' formats "%F{240}git:(%b)" #'%F{240}(%b)%r%f'
57 zstyle ':vcs_info:*' enable git