版权声明:本文为博主原创文章,欢迎转载。 https://blog.csdn.net/u010828718/article/details/81870445
1 iTerm2
OS X 下一款开源免费的的终端工具,用它替代了原生的 Terminal,与Oh My Zsh一起使用
安装
brew cask install iterm2
brew 主要用来下载一些不带界面的命令行下的工具和第三方库来进行二次开发
brew cask主要用来下载一些带界面的应用软件,下载好后会自动安装,并能在mac中直接运行使用
一些基本功能如下:
1、分窗口操作:shift+command+d(横向)command+d(竖向)
2、查找和粘贴:command+f,呼出查找功能,tab 键选中找到的文本,option+enter 粘贴
3、自动完成:command+; 根据上下文呼出自动完成窗口,上下键选择
4、粘贴历史:shift+command+h5、回放功能:option+command+b
6、全屏:command+enter
7、光标去哪了?command+/
8、Expose Tabs:Option+Command+E
功能还有很多,多用多体会。
2 oh-my-zsh
安装
sh -c "$(curl -fsSL https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh)"
3 配置
1 修改主题
# 修改 ZSH_THEME="主题名"
vim ~/.zshrc
ZSH_THEME="ys"
2 代码高亮 (zsh-syntax-highlighting)
# 1 安装
brew install zsh-syntax-highlighting
# 2 用 vim 打开 .zshrc 文件,找到插件设置命令(快捷键 /plugins=),默认是 plugins=(git)
plugins=(zsh-syntax-highlighting git)
3 自动提示命令(zsh-autosuggestions)
# 1 Homebrew安装
brew install zsh-autosuggestions
source /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh
# 2 修改字体浅淡(可省略)修改 ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=10'
vim /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh
4 快速切换目录(autojump)
autojump是一个命令行工具,它允许你可以直接跳转到你喜爱的目录,而不受当前所在目录的限制。意思就是可以让你更快地切换目录,而不用频繁地使用cd tab 等命令
# 1 安装
brew install autojump
# 2 用 vim 打开 .zshrc 文件,找到插件设置命令(快捷键 /plugins=),默认是 plugins=(git)
plugins=( autojump )
# 3 在source $ZSH/oh-my-zsh.sh 下边添加如下代码
[[ -s $(brew --prefix)/etc/profile.d/autojump.sh ]] && . $(brew --prefix)/etc/profile.d/autojump.sh
- 目录跳转:
j [目录的名字或名字的一部分] // 不受当前所在目录的限制
- 查看当前权重:
j --stat
- 进入权重最高的目录:
j
- 改变权重值
j -i [权重] // 增加
j -d [权重] // 减少
5 启动问候语设置
1 cd /etc
2 sudo pico motd
3 control+x
4 设置问候语
5 用 y保存退出,再 y一次确认文件名motd
6 设置背景图
pereference -> Profiles -> window -> Background image