iterm2和zsh
Contents
-
下载 iTerm2
-
zsh 系统自带,但不是最新,安装最新zsh
|
|
-
安装oh-my-zsh
1 2 3
git clone git@github.com:toxicwebdev/robbyrussell-oh-my-zsh.git ~/.oh-my-zsh # or git clone git@github.com:genDopamine/ohmyzsh.git ~/.oh-my-zsh
-
配置oh-my-zsh
1
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
-
兼容bash环境变量
1
echo "source ~/.bash_profile" >> ~/.zshrc #刷新bash的环境变量 ubuntu下不行可拷贝
-
修改shell
1
chsh -s /bin/zsh
-
更换主题 主题图鉴
1
vim ~/.zshrc //修改ZSH_THEME="avit"
挑几个自己喜欢的主题
- avit
- robbyrussell
-
插件 oh-my-zsh 可以绑定插件,可以变的更加漂亮。
-
命令高亮
-
1
brew install zsh-syntax-highlighting
-
1
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
-
1
vim ~/.zshrc #在 plugins=(...) 增加zsh-syntax-highlighting
-
-
自动补全命令
-
1
git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
-
1
vim ~/.zshrc #在 plugins=(...) 增加zsh-autosuggestions
-
-
官方插件非常多 plugins 激活方式
1
vim ~/.zshrc #在 plugins=(...) 增加插件
注: 如果插件下不下来(墙的问题)可copy https://gitee.com/Joker_null/plugins/tree/master/zsh 下的文件夹到
1 2 3 4 5 6
cp -r ./plugins/zsh/zsh-syntax-highlighting ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting cp -r ./plugins/zsh/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions vim ~/.zshrc #在 plugins=(...) 增加zsh-syntax-highlighting vim ~/.zshrc #在 plugins=(...) 增加zsh-autosuggestions
-
-
iterm2配置rz,sz
-
安装lrzsz
1
brew install lrzsz
-
复制两个shell脚本到
/usr/local/bin
下1 2
https://gitee.com/Joker_null/plugins/blob/master/zsh/iterm2-recv-zmodem.sh https://gitee.com/Joker_null/plugins/blob/master/zsh/iterm2-send-zmodem.sh
-
打开iterm2 Preferences -> Profiles -> Default -> Advanced 的 tab 页 -> Triggers - Edit
1 2 3 4 5 6 7 8 9
Regular expression: rz waiting to receive.\*\*B0100 Action: Run Silent Coprocess Parameters: /usr/local/bin/iterm2-send-zmodem.sh Instant: checked Regular expression: \*\*B00000000000000 Action: Run Silent Coprocess Parameters: /usr/local/bin/iterm2-recv-zmodem.sh Instant: checked
-