#------------------------------ # History #------------------------------ HISTFILE=~/.histfile HISTSIZE=10000 SAVEHIST="${HISTSIZE}" # Ignore duplicate in history. setopt hist_ignore_dups # Prevent record in history entry if preceding them with at least one space setopt hist_ignore_space setopt appendhistory autocd extendedglob notify # Nobody need flow control anymore. Troublesome feature. #stty -ixon setopt noflowcontrol # Fix for tmux on linux. case "$(uname -o)" in 'GNU/Linux') export EVENT_NOEPOLL=1 ;; esac # zargs, as an alternative to find -exec and xargs. autoload -U zargs # Turn on command substitution in the prompt (and parameter expansion and arithmetic expansion). setopt promptsubst # Not all servers have terminfo for rxvt-256color. if [ "${TERM}" = 'rxvt-256color' ] && ! [ -f '/usr/share/terminfo/r/rxvt-256color' ] && ! [ -f '/lib/terminfo/r/rxvt-256color' ] && ! [ -f "${HOME}/.terminfo/r/rxvt-256color" ]; then export TERM='rxvt-unicode' fi if ! [[ "${PATH}" =~ "^${HOME}/bin" ]]; then export PATH="${HOME}/bin:${PATH}" fi PATH=$PATH:/home/epheo/.local/bin source ~/.zsh_alias #------------------------------ # Variables #------------------------------ export BROWSER=/usr/bin/qutebrowser export EDITOR=/usr/bin/vim #----------------------------- # Dircolors #----------------------------- LS_COLORS='rs=0:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:tw=30;42:ow=34;42:st=37;44:ex=01;32:'; export LS_COLORS #------------------------------ # Keybindings #------------------------------ bindkey -v typeset -g -A key bindkey '\e[1~' beginning-of-line bindkey '\e[4~' end-of-line bindkey '^?' backward-delete-char bindkey '^[[1~' beginning-of-line bindkey '^[[5~' up-line-or-history bindkey '^[[3~' delete-char bindkey '^[[4~' end-of-line bindkey '^[[6~' down-line-or-history bindkey '^[[A' up-line-or-search bindkey '^[[D' backward-char bindkey '^[[B' down-line-or-search bindkey '^[[C' forward-char # for rxvt bindkey "\e[8~" end-of-line bindkey "\e[7~" beginning-of-line # Control-v to open current line in $EDITOR autoload -U edit-command-line zle -N edit-command-line bindkey '^v' edit-command-line #------------------------------ # Completion stuff #------------------------------ zmodload zsh/complist autoload -Uz compinit compinit zstyle :compinstall filename '${HOME}/.zshrc' #- buggy zstyle ':completion:*:descriptions' format '%U%B%d%b%u' zstyle ':completion:*:warnings' format '%BSorry, no matches for: %d%b' #-/buggy zstyle ':completion:*:pacman:*' force-list always zstyle ':completion:*:*:pacman:*' menu yes select zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} zstyle ':completion:*:*:kill:*' menu yes select zstyle ':completion:*:kill:*' force-list always zstyle ':completion:*:*:killall:*' menu yes select zstyle ':completion:*:killall:*' force-list always #------------------------------ # Prompt #------------------------------ autoload -U colors zsh/terminfo colors autoload -Uz vcs_info zstyle ':vcs_info:*' enable git hg zstyle ':vcs_info:*' check-for-changes true zstyle ':vcs_info:git*' formats "%{${fg[cyan]}%}[%{${fg[green]}%}%s%{${fg[cyan]}%}][%{${fg[blue]}%}%r/%S%%{${fg[cyan]}%}][%{${fg[blue]}%}%b%{${fg[yellow]}%}%m%u%c%{${fg[cyan]}%}]%{$reset_color%}" setprompt() { setopt prompt_subst if [[ -n "$SSH_CLIENT" || -n "$SSH2_CLIENT" ]]; then p_host='%F{cyan}[%f%(!.%F{red}%n%f.%F{green}%n%f)%F{cyan}@%f%F{yellow}%M%f%F{cyan}]%f' else p_host='' fi PS1=${(j::Q)${(Z:Cn:):-$' ${p_host} %F{cyan}[%f %F{blue}%~%f %F{cyan}]%f %(!.%F{red}%#%f.%F{green}%#%f) " " '}} PS2=$'%_>' RPROMPT=$'${vcs_info_msg_0_}' } setprompt #------------------------------ # Start with login on tty1 #------------------------------ if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then exec startx fi if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty2 ]]; then exec /usr/bin/jackd -dalsa -dhw:0 -r48000 -p1024 -n2 & exec sway fi #------------------------------ # ShellFuncs #------------------------------ # -- coloured manuals man() { env \ LESS_TERMCAP_mb=$(printf "\e[1;31m") \ LESS_TERMCAP_md=$(printf "\e[1;31m") \ LESS_TERMCAP_me=$(printf "\e[0m") \ LESS_TERMCAP_se=$(printf "\e[0m") \ LESS_TERMCAP_so=$(printf "\e[1;44;33m") \ LESS_TERMCAP_ue=$(printf "\e[0m") \ LESS_TERMCAP_us=$(printf "\e[1;32m") \ man "$@" } notes() { if [ ! -z "$1" ]; then # Using the "$@" here will take all parameters passed into # this function so we can place everything into our file. echo "$@" >> "$HOME/notes.md" else # If no arguments were passed we will take stdout and place # it into our notes instead. cat - >> "$HOME/notes.md" fi } # vim: set ts=2 sw=2 et: