Newer
Older
dotfiles / zsh / zshrc.symlink
@Marcus Bengtsson Marcus Bengtsson on 23 Aug 2015 1020 bytes Prompt in vi mode instead of emacs
# .zshrc

# If not running interactively, don't do anything
[[ $- != *i* ]] && return

export DOTFILES=$HOME/.dotfiles
export ZSH=$DOTFILES/zsh


# Source config-files
for config ($ZSH/**/*.zsh) source $config

# Source git-completion and git-prompt
source $DOTFILES/git/git-prompt.sh
source $DOTFILES/git/git-completion.zsh &>/dev/null

# Init autocomplete
autoload -U compinit
compinit

# History
export HISTFILE=~/.zsh_history
export HISTSIZE=10000
export SAVEHIST=10000

setopt SHARE_HISTORY
setopt HIST_IGNORE_ALL_DUPS
setopt APPEND_HISTORY

setopt COMPLETE_ALIASES

# Vi mode
bindkey -v
zle -N zle-line-init
zle -N zle-keymap-select

# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"

# Add an "alert" alias for long running commands.  Use like so:
#   sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'