wget --no-check-certificate https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh
cygwin默认启动使用bash, 修改.bashrc文件添加
exec zsh
我的zsh配置文件,供参考
export ZSH=$HOME/.oh-my-zsh
ZSH_THEME="ys"
DISABLE_AUTO_UPDATE="true"
plugins=(git textmate ruby autojump osx mvn gradle)
export PATH=$HOME/bin:/usr/local/bin:$PATH
source $ZSH/oh-my-zsh.sh
if [[ -n $SSH_CONNECTION ]]; then
export EDITOR='vim'
else
export EDITOR='vim'
fi
alias vi='vim'
alias drccd="ssh sun59@drccd.dr.avaya.com"
alias toolsa="ssh sun59@st3tds04.us1.avaya.com"
alias vsp_test='ssh admin@192.168.65.31'
alias sb='screen -S hugh -c /home/Administrator/screen/screenrc'
alias sx='screen -r hugh'
alias vm='screen -S vm -c /home/Administrator/screen/vm'
alias ls='ls --color'
alias grep='grep --color'
alias open='cygstart'
export LANG=en_US.UTF-8
echo -e "\033[33mWelcome to Linux World\033[0m"
alias rm='rm -i'
alias ca='screen -S ca -c /home/Administrator/screen/test'
alias c2="noglob sh c2"
alias mm='open /home/Administrator/Desktop/Tools/sublime/Docs/Markdown/web_service.md'
alias c='pygmentize -g'
ANSIBLE=/opt/ansible
export PATH=$PATH:$ANSIBLE/bin
export PYTHONPATH=$ANSIBLE/lib
export ANSIBLE_LIBRARY=$ANSIBLE/library
export CHEATCOLORS=true
function _cheat_autocomplete {
sheets=$(cheat -l | cut -d' ' -f1)
COMPREPLY=()
if [ $COMP_CWORD = 1 ]; then
COMPREPLY=(`compgen -W "$sheets" -- $2`)
fi
}
export PATH=/cygdrive/c/Users/Administrator/Desktop/Tools/sublime/Docs/python/bin:$PATH
安装autojump
wget https://github.com/downloads/joelthelion/autojump/autojump_v21.1.2.tar.gz
tar -xf autojump_v21.1.2.tar.gz
cd autojump_v21.1.2
./install.sh
然后安装tmux, 直接按照tmux的官方文档安装
git clone https://github.com/tmux/tmux.git
cd tmux
sh autogen.sh
./configure && make
然后配置tmux, 下面是我tmux的配置文件, 我的bind key是^o, 不同于默认的^a, 因为在linux系统中经常要使用^a回到行首.
主要实现了几个功能.
1. 快速打开man page 使用bindkey + m
2. 快速的记录笔记 bindkey + n
3. 快速的打开一个开发环境连接 bindkey + a
4. 快速的打开小抄功能(cheat)
5. 绑定使用快捷键, 比如alt + 1输入一个常用的默认密码itsgrand3
# released under the WTFPL v2 license, by Gregory Pakosz (@gpakosz)
# modified by Ying. last version 2016/8/15
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set-option -g @plugin knakayama/tmux-newline-detector
run '~/.tmux/plugins/tpm/tpm'
set -g prefix ^o
unbind ^b
set -g -q mouse off
set -g default-terminal "screen-256color" # colors!
setw -g xterm-keys on
set -s escape-time 0 # fastest command sequences
set -sg repeat-time 600 # increase repeat timeout
set -s quiet on # disable various messages
set -g history-limit 65535 # boost history
bind r source-file ~/.tmux.conf \; display '~/.tmux.conf sourced'
if 'which -s reattach-to-user-namespace' 'set -g default-command "exec initializing... 2> /dev/null & reattach-to-user-namespace $SHELL -l"'
set -g base-index 1 # start windows numbering at 1
setw -g pane-base-index 1 # make pane numbering consistent with windows
setw -g automatic-rename on # rename window to reflect current program
set -g renumber-windows on
set -g set-titles on # set terminal title
set -g set-titles-string '#h ❐ #S ● #I #W'
set -g display-panes-time 800 # slightly longer pane indicators display time
set -g display-time 1000 # slightly longer status messages display time
set -g status-interval 10 # redraw status line every 10 seconds
setw -g clock-mode-style 24
bind -n C-l send-keys C-l \; run 'tmux clear-history'
set -g monitor-activity on
set -g visual-activity off
bind C-f command-prompt -p find-session 'switch-client -t %%'
bind -r h select-pane -L # move left
bind -r j select-pane -D # move down
bind -r k select-pane -U # move up
bind -r l select-pane -R # move right
bind > swap-pane -D # swap current pane with the next one
bind < swap-pane -U # swap current pane with the previous one
bind + run 'cut -c3- ~/.tmux.conf | sh -s maximize_pane'
bind -r H resize-pane -L 2
bind -r J resize-pane -D 2
bind -r K resize-pane -U 2
bind -r L resize-pane -R 2
unbind n
unbind p
bind -r C-h previous-window # select previous window
bind -r C-l next-window # select next window
bind Tab last-window # move to last active window
bind m command-prompt "splitw 'exec man %%'" # man (prefix m)
bind n command-prompt "splitw 'exec vi ~/notes/`date +%F`_%%'"
bind a run "tmux splitw /usr/bin/ssh sun59@st3tds04.us1.avaya.com"
bind y run "tmux splitw /usr/bin/ssh 127.0.0.1"
bind e command-prompt "splitw 'exec cheat -e %%'"
bind U run "cut -c3- ~/.tmux.conf | sh -s urlview #{pane_id}"
bind F run "cut -c3- ~/.tmux.conf | sh -s fpp #{pane_id}"
bind -t vi-choice h tree-collapse
bind -t vi-choice l tree-expand
run -b 'tmux bind -t vi-choice K start-of-list 2> /dev/null'
run -b 'tmux bind -t vi-choice J end-of-list 2> /dev/null'
bind -t vi-choice H tree-collapse-all
bind -t vi-choice L tree-expand-all
bind -t vi-choice Escape cancel
bind -ct vi-edit H start-of-line
bind -ct vi-edit L end-of-line
bind -ct vi-edit q cancel
bind -ct vi-edit Escape cancel
bind Escape copy-mode # enter copy mode
bind b list-buffers # list paster buffers
bind p paste-buffer # paste from the top pate buffer
bind P choose-buffer # choose which buffer to paste from
bind -t vi-copy v begin-selection
bind -t vi-copy C-v rectangle-toggle
bind -t vi-copy y copy-selection
bind -t vi-copy Escape cancel
bind -t vi-copy H start-of-line
bind -t vi-copy L end-of-line
if -b 'which -s reattach-to-user-namespace' 'bind y run "tmux save-buffer - | reattach-to-user-namespace pbcopy"'
if '[ -f ~/.tmux.conf.local ]' 'source ~/.tmux.conf.local'
unbind '"'
bind - splitw -v # vertical split (prefix -)
unbind %
bind | splitw -h # horizontal split (prefix |)
set -g @plugin 'tmux-plugins/tmux-logging'
run-shell ~/clone/path/logging.tmux
bind-key -n M-1 send-keys itsgrand3
bind-key -n M-2 send-keys admin01
bind-key -n M-3 send-keys root01
bind-key -n M-4 send-keys sroot01
bind-key -n M-5 send-keys Administrator
bind-key -n M-6 send-keys redhat
bind-key -n F1 send-keys Escape x
bind-key -n F2 send-keys Escape r
bind-key -n F3 send-keys Escape e
bind-key -n F5 send-keys Escape h
bind-key -n F7 send-keys Escape n
bind-key -n F8 send-keys Escape p
日志功能需要安装tmux的插件