Created
September 12, 2013 18:53
-
-
Save wolfiestyle/6542213 to your computer and use it in GitHub Desktop.
zshrc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # completion | |
| autoload -U compinit && compinit | |
| zstyle ':completion:*:descriptions' format '%F{green}%B-- %d%b%f' | |
| zstyle ':completion:*:warnings' format '%F{red}%Bno matches for:%b%f %d' | |
| zstyle ':completion:*' group-name '' | |
| zstyle ':completion:*' menu select | |
| zstyle ':completion:*' special-dirs .. | |
| zstyle ':completion:*:*:kill:*' command 'ps -u$USER -o pid,%cpu,tty,cputime,cmd' | |
| # correction | |
| #setopt correctall | |
| #alias cp='nocorrect cp' | |
| #alias mv='nocorrect mv' | |
| #alias rm='nocorrect rm' | |
| #alias mkdir='nocorrect mkdir' | |
| #alias man='nocorrect man' | |
| # prompt | |
| PS1='%B%F{cyan}%K{blue}%~%k%f%b | |
| %(!.%B%F{red}.%F{green})%?,%n@%m%f%(!.%b#.$) ' | |
| PS2='%B>%b ' | |
| # history | |
| HISTFILE=~/.zsh_history | |
| HISTSIZE=1024 | |
| SAVEHIST=$HISTSIZE | |
| setopt append_history | |
| setopt hist_ignore_all_dups | |
| # colors | |
| [ -f /etc/DIR_COLORS ] && eval $(dircolors -b /etc/DIR_COLORS) | |
| alias ls='ls --color=auto' | |
| alias grep='grep --color=auto' | |
| # terminal title | |
| case $TERM in | |
| xterm*|rxvt*|(dt|k|E|a)term) | |
| chpwd() { print -Pn "\e]0;%n@%m:%~\a" } | |
| print -Pn "\e]0;%n@%m:%~\a" | |
| ;; | |
| screen*) | |
| preexec () { | |
| local CMD=${1[(wr)^(*=*|sudo|-*)]} | |
| echo -ne "\ek$CMD\e\\" | |
| } | |
| chpwd() { print -Pn "\e]0;%n@%m:%~\a" } | |
| print -Pn "\e]0;%n@%m:%~\a" | |
| ;; | |
| esac | |
| # keybinds | |
| bindkey -e | |
| bindkey "$terminfo[khome]" beginning-of-line | |
| bindkey "$terminfo[kend]" end-of-line | |
| bindkey "$terminfo[kdch1]" delete-char | |
| bindkey "$terminfo[kich1]" overwrite-mode | |
| if [ $TERM != "linux" ]; then | |
| bindkey "$terminfo[kRIT5]" forward-word | |
| bindkey "$terminfo[kLFT5]" backward-word | |
| bindkey "$terminfo[kDC5]" kill-word | |
| if [ $TERM != "xterm" ]; then | |
| bindkey "$terminfo[kbs]" backward-kill-word | |
| fi | |
| fi | |
| # misc | |
| #setopt autocd | |
| setopt extendedglob | |
| # aliases | |
| alias ll='ls -l' | |
| alias llh='ls -lh' | |
| alias df='df -h' | |
| alias psgrep='ps -A | grep $1' | |
| alias v='feh' | |
| alias dd_prog='killall -s USR1 dd' | |
| alias conf_lines="egrep -v '^\s*#|^\s*$'" | |
| if [[ -n "$DISPLAY" && -z "$SSH_CONNECTION" ]]; then | |
| if [ `id -u` != "0" ]; then | |
| _E="sublime_text" | |
| else | |
| _E="evim" | |
| fi | |
| else | |
| _E="vim" | |
| fi | |
| alias e="$_E" | |
| unset _E |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment