安装使用
-
- 或者是如果之前安装了homebrew 可以通过
brew cask install iterm2
-
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)" speed
- 后续安装 都可以使用
brew install xxx
-
sh -c "$(curl -fsSL ``https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
- 安装好之后,需要把 Zsh 设置为当前用户的默认 Shell(这样新建标签的时候才会使用 Zsh):
-
-
cd ~/.oh-my-zsh/themes
- 里面有很多文件 都是主题,将文件名称 改到上一步就完成了更改主题
- 更改完成之后 重启 或者
source ~/.zshrc
-
-
git clone https://github.com/zsh-users/zsh-autosuggestions~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
- 然后编辑
vim ~/.zshrc文件,找到plugins配置,增加zsh-autosuggestions插件
source ~/.zshrc
github访问太慢,并且仓库地址不正确一直报443,所以换以下路径,clone
git clone https://gitee.com/phpxxo/zsh-autosuggestions.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
-
-
cd ~/.oh-my-zsh/custom/plugins
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
vim ~/.zshrc -- 如果没有权限 增加 sudo
- 修改
plugins=(git zsh-autosuggestions zsh-syntax-highlighting)
source ~/.zshrc -- 让改动生效
快捷命令
| 标签 | |
|---|
| 新建标签 | command + t |
| 关闭标签 | command + w |
| 切换标签 | command + 数字 / command + 左右方向键 |
| 切换全屏 | command + enter |
| 查找 | command + f |
| 分屏 | |
| 垂直分屏 | command + d |
| 水平分屏 | command + shift + d |
| 切换屏幕 | command + option + 方向键 command + [ 或 command + ] |
| 查看历史命令 | command + ; |
| 查看剪贴板历史 | command + shift + h |
| 其他 | |
| 清除当前行 | ctrl + u |
| 到行首 | ctrl + a |
| 到行尾 | ctrl + e |
| 前进后退 | ctrl + f/b (相当于左右方向键) |
| 上一条命令 | ctrl + p |
| 搜索命令历史 | ctrl + r |
| 删除当前光标的字符 | ctrl + d |
| 删除光标之前的字符 | ctrl + h |
| 删除光标之前的单词 | ctrl + w |
| 删除到文本末尾 | ctrl + k |
| 交换光标处文本 | ctrl + t |
| 清屏1 | command + r |
| 清屏2 | ctrl + l |
有可能遇到的问题 & 解决方案
- 默认输入类似 git branch / 的时候会进入vim编辑页面
-
git config --global core.pager ''