Skip to content

Instantly share code, notes, and snippets.

@MayeulC
Created May 17, 2017 20:17
Show Gist options
  • Save MayeulC/79fab951dad4cf3917d8660d54eecdd8 to your computer and use it in GitHub Desktop.
Save MayeulC/79fab951dad4cf3917d8660d54eecdd8 to your computer and use it in GitHub Desktop.
My .zshrc (nothing fancy, it "just works™")
# The following lines were added by compinstall
zstyle ':completion:*' completer _expand _complete _ignored _correct _approximate
zstyle ':completion:*' menu select=1
zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
zstyle :compinstall filename '/home/mayeul/.zshrc'
autoload -Uz compinit
compinit
# End of lines added by compinstall
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
setopt share_history
setopt nomatch
unsetopt appendhistory autocd beep extendedglob notify
bindkey -e
# End of lines configured by zsh-newuser-install
# create a zkbd compatible hash;
# to add other keys to this hash, see: man 5 terminfo
typeset -A key
key[Home]=${terminfo[khome]}
key[End]=${terminfo[kend]}
key[Insert]=${terminfo[kich1]}
key[Delete]=${terminfo[kdch1]}
key[Up]=${terminfo[kcuu1]}
key[Down]=${terminfo[kcud1]}
key[Left]=${terminfo[kcub1]}
key[Right]=${terminfo[kcuf1]}
key[PageUp]=${terminfo[kpp]}
key[PageDown]=${terminfo[knp]}
# setup key accordingly
[[ -n "${key[Home]}" ]] && bindkey "${key[Home]}" beginning-of-line
[[ -n "${key[End]}" ]] && bindkey "${key[End]}" end-of-line
[[ -n "${key[Insert]}" ]] && bindkey "${key[Insert]}" overwrite-mode
[[ -n "${key[Delete]}" ]] && bindkey "${key[Delete]}" delete-char
[[ -n "${key[Up]}" ]] && bindkey "${key[Up]}" up-line-or-history
[[ -n "${key[Down]}" ]] && bindkey "${key[Down]}" down-line-or-history
[[ -n "${key[Left]}" ]] && bindkey "${key[Left]}" backward-char
[[ -n "${key[Right]}" ]] && bindkey "${key[Right]}" forward-char
[[ -n "${key[PageUp]}" ]] && bindkey "${key[PageUp]}" beginning-of-buffer-or-history
[[ -n "${key[PageDown]}" ]] && bindkey "${key[PageDown]}" end-of-buffer-or-history
# Finally, make sure the terminal is in application mode, when zle is
# active. Only then are the values from $terminfo valid.
if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then
function zle-line-init () {
printf '%s' "${terminfo[smkx]}"
}
function zle-line-finish () {
printf '%s' "${terminfo[rmkx]}"
}
zle -N zle-line-init
zle -N zle-line-finish
fi
if [ -f ~/.config/dir_colors ]; then
eval `dircolors ~/.config/dir_colors`
fi
export GTK_IM_MODULE='uim'
export XMODIFIERS='@im=uim'
export QT_IM_MODULE='uim'
function collapse_pwd {
echo $(pwd | sed -e "s,^$HOME,~,")
}
autoload -U colors && colors
export PROMPT="%B%F{green}%n%f%b@%F{cyan}%m%f %B%40<..<%~%<< %b%# "
# ou bien : export PS1="%B%F{green}%(?..%? )%f%b%B%F{green}%n%f%b@%m %B%40<..<%~%<< %b%# "
export RPROMPT='%(?,%F{green}:%),%F{yellow}%? %F{red}:()%f'
#export ZLS_COLORS=$LS_COLORS
export EDITOR=vim
alias lspci='/sbin/lspci'
alias ls='ls -hp --time-style=locale --color=auto'
alias ll='ls -al --color=auto'
alias lt="/home/mayeul/Documents/scripts/tree.sh"
alias uncomment="egrep -v \"^#|^$\""
alias fixsteam='find ~/.steam/root/ \( -name "libgcc_s.so*" -o -name "libstdc++.so*" -o -name "libxcb.so*" -o -name "libgpg-error.so*" \) -print -delete'
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
#zstyle -e ':completion:*:default' list-colors 'reply=("${PREFIX:+=(#bi)($PREFIX:t)(?)*==02=01}:${(s.:.)LS_COLORS}")'
#zstyle -e ':completion:*:default' list-colors 'reply=("${PREFIX:+=(#bi)($PREFIX:t)(?)*==34=34}:${(s.:.)LS_COLORS}")';
#source /home/mayeul/Xilinx/14.7/ISE_DS/settings64.csh
#. /home/mayeul/Xilinx/14.7/ISE_DS/settings64.sh
PATH="/home/mayeul/perl5/bin${PATH+:}${PATH}"; export PATH;
PERL5LIB="/home/mayeul/perl5/lib/perl5${PERL5LIB+:}${PERL5LIB}"; export PERL5LIB;
PERL_LOCAL_LIB_ROOT="/home/mayeul/perl5${PERL_LOCAL_LIB_ROOT+:}${PERL_LOCAL_LIB_ROOT}"; export PERL_LOCAL_LIB_ROOT;
PERL_MB_OPT="--install_base \"/home/mayeul/perl5\""; export PERL_MB_OPT;
PERL_MM_OPT="INSTALL_BASE=/home/mayeul/perl5"; export PERL_MM_OPT;
#### Below is for enabling gpg auth for ssh, useful with a smartcard
# Start the gpg-agent if not already running
if ! pgrep -x -u "${USER}" gpg-agent >/dev/null 2>&1; then
gpg-connect-agent /bye >/dev/null 2>&1
fi
# Set SSH to use gpg-agent
unset SSH_AGENT_PID
if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then
export SSH_AUTH_SOCK="/run/user/$UID/gnupg/S.gpg-agent.ssh"
fi
# Set GPG TTY
export GPG_TTY=$(tty)
# Refresh gpg-agent tty in case user switches into an X session
gpg-connect-agent updatestartuptty /bye >/dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment