安裝iterm2
說明:
mac系統(tǒng)上替代終端的命令行工具
安裝方法:
直接從官網(wǎng)下載安裝即可,下載地址
安裝brew
說明:
Homebrew,是Mac OSX的軟件包管理工具,安裝或者卸載軟件非常方便,類似Linux下的apt-get
安裝方法:
- 方法一:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- 方法二:
curl -LsSf http://github.com/mxcl/homebrew/tarball/master | sudo tar xvz -C/usr/local --strip 1
例子:
brew install wget
brew uninstall wget
安裝oh my zsh
說明:
Linux/Unix提供了很多種shell,常用的shell有sh、bash、csh,執(zhí)行命令cat /etc/shells可以系統(tǒng)有幾種shell
/bin/bash
/bin/csh
/bin/ksh
/bin/sh
/bin/tcsh
/bin/zsh
zsh就是shell中的一種,但是配置復(fù)雜,于是有大神就開發(fā)了oh my zsh
安裝方法:
- 方法一:
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
- 方法二:
sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
配置:
- 設(shè)置zsh為默認(rèn)的shell,chsh -s /bin/zsh
- 使用主題(推薦使用agnoster)
- 下載agnoster主題,下載地址
- 打開zsh的配置文件,vi ~/.zshrc
- 修改ZSH_THEME的字段為agnoster,ZSH_THEME="agnoster"
- 安裝字體庫
- 下載字體庫,下載地址
- cd到文件目錄,執(zhí)行./install.sh
- 設(shè)置字體,iterm2 -> profiles -> open profiles(或者直接cmd+o) -> edit profiles -> text -> change font,設(shè)置你喜歡的字體和大小即可
- 配色(推薦使用Solarized)
- 下載Solarized,下載地址
- cd到solarized/iterm2-colors-solarized
- 雙擊Solarized Dark.itermcolors和Solarized Light.itermcolors,導(dǎo)入iterm2
- 設(shè)置配色,iterm2 -> profiles -> open profiles(或者直接cmd+o) -> edit profiles -> colors -> color presets -> Solarized Dark
- 設(shè)置vim配色
$ cd solarized $ cd vim-colors-solarized/colors $ mkdir -p ~/.vim/colors $ cp solarized.vim ~/.vim/colors/$ vi ~/.vimrc syntax enable set background=dark colorscheme solarized - 指令高亮
下載zsh-syntax-highlighting,下載地址
移到zsh插件文件中,mv zsh-syntax-highlighting ~/.oh-my-zsh/custom/plugins/
-
修改配置文件,vi ~/.zshrc,添加如下語句
plugins=(zsh-syntax-highlighting) source ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh 執(zhí)行source ~/.zshrc
iterm2克隆會話(clone-session)
說明:
一般IT公司開發(fā),都需要先登入跳板機(jī),然后登入開發(fā)機(jī)。每次開一個(gè)新窗口時(shí),如果都要輸入密碼,非常麻煩。Windows下用過SecureCRT的人都知道,它只要一次輸入密碼即可。我們使用mac的iterm2時(shí),也可以實(shí)現(xiàn)同樣的功能。
配置:

修改iterm2配置,iterm2 -> profiles -> open profiles(或者直接cmd+o) -> edit profiles -> general -> reuse previous session's directory
-
修改ssh配置文件,vi ~/.ssh/config
host * ControlMaster auto ControlPath ~/.ssh/master-%r@%h:%p
未完待續(xù)。。。