iTerm2
Mac的终端不好用吗,是时候换一款终端了了iTerm2,
下载:https://iterm2.com/
你要说好用在哪,可以看看这个
https://iterm2.com/features.html
技巧:Iterm2命令行终端跳过单词设置
正常windows下xshell是通过CTRL+方向键来控制左右跳过完整单词,或者是ALT+B/F,而Iterm2要做一下简单设置才行
1、Iterm2->Setting->Profiles->Keys->Key Mappings
找到⌥ ←这个Key Combination,修改为
同理,向右如下设置
zsh
zsh是shell语言类型,兼容bash,提供强大的命令行功能,比如tab补全,自动纠错功能等。缺点就是配置太麻烦,好在有一个叫做oh-my-zsh的开源项目,很好的弥补了这一缺陷,只需要修修改改配置文件,就能很顺手。
安装zsh
查看系统当前使用的shell
$ echo $SHELL
/bin/bash
查看系统是否安装了zsh
$ cat /etc/shells
/bin/sh
/bin/bash
/sbin/nologin
/usr/bin/sh
/usr/bin/bash
/usr/sbin/nologin
/bin/tcsh
/bin/csh
没有的话则安装:
brew install zsh
切换shell为zsh
$ chsh -s /bin/zsh
Changing shell for root.
Shell changed.
重启后,查看当前shell
$ echo $SHELL
/bin/zsh
安装 oh my zsh
oh-my-zsh源码是放在github上,先确保你的机器上已安装了git和wget
没wget则安装:
brew install wget
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh
成功界面:
____ / /_ ____ ___ __ __ ____ _____/ /_
/ __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \
/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / /
\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/
/____/ ....is now installed!
Please look over the ~/.zshrc file to select plugins, themes, and options.
p.s. Follow us at https://twitter.com/ohmyzsh.
p.p.s. Get stickers and t-shirts at http://shop.planetargon.com.
接下来只需简单的配置,就可以享受oh-my-zsh的强大
oh-my-zsh有很多漂亮的主题:
https://github.com/robbyrussell/oh-my-zsh/wiki/themes
我使用的主题是ys
修改主题:
$ vim ~/.zshrc
将ZSH_THEME改成ys
ZSH_THEME="ys"
更新配置:
$ source ~/.zshrc
iterm设置alias指令别名
open ~/.zshrc
加入
alias pu='pod update'
alias pi='pod install'