Skip to content

Instantly share code, notes, and snippets.

@andelf
Last active December 29, 2015 07:39
Show Gist options
  • Select an option

  • Save andelf/7637220 to your computer and use it in GitHub Desktop.

Select an option

Save andelf/7637220 to your computer and use it in GitHub Desktop.
dot.files
:set prompt "λ> "
:set +t
#设置终端颜色为256色
set -g default-terminal "screen-256color"
#set -sg escape-time 1
# auto resize to smallest windows size
setw -g aggressive-resize on
# Terminal emulator window titles
set -g set-titles on
set -g set-titles-string "#T"
#将激活控制台的快捷键由Ctrl+b修改为Ctrl+z
set-option -g prefix C-z
unbind-key C-b
bind-key C-z send-prefix
#此类配置可以在命令行模式中输入show-options -g查询
set-option -g base-index 1 #窗口的初始序号;默认为0,这里设置为1
set-option -g display-time 5000 #提示信息的持续时间;设置足够的时间以避免看不清提示,单位为毫秒
set-option -g repeat-time 1000 #控制台激活后的持续时间;设置合适的时间以避免每次操作都要先激活控制台,单位为毫秒
set-option -g status-keys emacs #操作状态栏时的默认键盘布局;可以设置为vi或emacs
set-option -g status-right "#(date '+%Y%m%d %H:%M ')" #状态栏右方的内容;这里的设置将得到类似23:59的显示
set-option -g status-right-length 15 #状态栏右方的内容长度;建议把更多的空间留给状态栏左方(用于列出当前窗口)
set-option -g status-utf8 on #开启状态栏的UTF-8支持
#pane setting
set-option -g pane-base-index 1
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind H resize-pane -L 5
bind J resize-pane -D 5
bind K resize-pane -U 5
bind L resize-pane -R 5
bind | split-window -h
bind - split-window -v
#设置当前窗口在status bar中的颜色
setw -g window-status-current-fg white
setw -g window-status-current-bg red
setw -g window-status-current-attr bright
#此类设置可以在命令行模式中输入show-window-options -g查询
set-window-option -g mode-keys emacs #复制模式中的默认键盘布局;可以设置为vi或emacs
set-window-option -g utf8 on #开启窗口的UTF-8支持
#其他窗口的活动
#setw -g monitor-activity on
#set -g visual-activity on
#左边栏状态
set -g status-left-length 40
set -g status-left "#[fg=black][#S] (#[fg=yellow]#I:#[fg=blue]#P)"
#添加自定义快捷键
#bind-key z kill-session #按z结束当前会话;相当于进入命令行模式后输入kill-session
# The following lines were added by compinstall
#zstyle :compinstall filename '/Users/wangshuyu/.zshrc'
autoload -Uz compinit
compinit
# End of lines added by compinstall
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
# End of lines configured by zsh-newuser-install
# Set prompt (white and purple, nothing too fancy)
export PATH=$HOME/.cabal/bin:$HOME/go/bin:$HOME/.gem/ruby/1.9.1/bin:/usr/local/bin:/usr/local/sbin:/usr/local/share/python:$PATH
PS1=$'%{\e[0;37m%}%B%*%b %{\e[0;34m%}%m:%{\e[0;37m%}%~ %(!.#.>) %{\e[00m%}'
# env
export NODE_PATH=$HOME/node_modules
if [[ -d $NODE_PATH/.bin ]]; then
export PATH=$PATH:$NODE_PATH/.bin
fi
# Enable color support of ls on Mac
alias ls="ls -G"
alias dir="dir --color=auto"
alias grep="grep --colour=auto"
alias zssh='ssh -o "UserKnownHostsFile /dev/null" -o StrictHostKeyChecking=no'
alias zscp='scp -o "UserKnownHostsFile /dev/null" -o StrictHostKeyChecking=no'
# Set less options
if [[ -x $(which less) ]] then
export PAGER="less"
export LESS="--ignore-case --LONG-PROMPT --QUIET --quit-if-one-screen --no-init -r"
fi
# set default editor
# set default editor to EMACS
if [[ -x /tmp/emacs`id -u`/server ]] then
export EDITOR="emacsclient -t"
export USE_EDITOR=$EDITOR
export VISUAL="emacsclient -c"
# alias e='emacsclient -t' # use tty
alias emacs='emacsclient -c' # use frame
elif [[ -x $(which emacs) ]] then
export EDITOR="emacs -nw --quick"
export USE_EDITOR=$EDITOR
export VISUAL="emacs --quick"
# alias e='emacs -nw --quick' # quick emacs
else
export EDITOR=vi
fi
alias -g e='emacs -q'
# Alias
alias gl="git log --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
alias lg='git log --graph --full-history --all --color --pretty=format:"%x1b[31m%h%x09%x1b[32m%d%x1b[0m%x20%s"'
alias free='free -m' # User MB
alias df='df -h' # make df display use MB, GB
alias cls=clear # cls :)
alias dir='ls -lha' # more detail than ls
alias ftp='lftp' # A good ftp
alias grep='grep --colour'
alias mkdir='mkdir -p' # for convenience, auto make parent
alias 'cd..=cd ..'
alias e='emacs --no-init --quick'
export GOPATH=$HOME/go/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment