安裝iterm2
說(shuō)明:
mac系統(tǒng)上替代終端的命令行工具
安裝方法:
直接從官網(wǎng)下載安裝即可津滞,下載地址
安裝brew
說(shuō)明:
Homebrew,是Mac OSX的軟件包管理工具秀姐,安裝或者卸載軟件非常方便既忆,類(lèi)似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
說(shuō)明:
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ù)雜洪乍,于是有大神就開(kāi)發(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主題夜焦,下載地址
- 打開(kāi)zsh的配置文件壳澳,vi ~/.zshrc
- 修改ZSH_THEME的字段為agnoster,ZSH_THEME="agnoster"
- 安裝字體庫(kù)
- 下載字體庫(kù)茫经,下載地址
- 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终佛,添加如下語(yǔ)句
plugins=(zsh-syntax-highlighting) source ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
執(zhí)行source ~/.zshrc
iterm2克隆會(huì)話(clone-session)
說(shuō)明:
一般IT公司開(kāi)發(fā),都需要先登入跳板機(jī)雾家,然后登入開(kāi)發(fā)機(jī)铃彰。每次開(kāi)一個(gè)新窗口時(shí),如果都要輸入密碼芯咧,非常麻煩牙捉。Windows下用過(guò)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ù)。蓝纲。阴孟。