当前位置: 首页 > Linux

工具:iTerm和Zsh

时间:2023-04-06 19:41:03 Linux

iTerm和ZshiTerm2安装配置作者:studytime原文:https://www.studytime.xin/安装iTerm2比较简单,直接从官网下载安装即可。安装之后,我们还需要进行一系列的设置。主题配置iTerm2支持很多主题色,可以自己定义,也可以参考网上现成的主题色。我个人更喜欢draculatheme配色方案。支持item、vim、phpstorm,下面有主题官网路径,按照教程安装即可。下面是一些常用的主题配色方案的预设文件:iTerm2dracula配色方案:https://draculatheme.com/iterm/iTerm2Solarized配色方案:https://github.com/altercation/solarizediTerm2配色方案采集网站:http://iterm2colorschemes.com/iTerm2配色合集GitHub地址:https://github.com/mbadolato/iTerm2-Color-Schemes/tree/master/schemes这些配色预设文件可以直接导入iTerm2,然后直接选择在设置中:其他配置来区分目录和文件的颜色设置:Preferences->Profiles->Text->TextRendering去掉Drawboldtextinbrightcolors前面的勾,文件和目录可以很容易的区分...命令别名在.zshrc中配置别名,可以很方便的为其他命令设置别名,这是一个很好的功能。vim~/.zshrc#Forserver#aliasweiyidev="sshweiyidev"#aliasstudytime="sshstudytime"#Forgitaliasgs="gitstatus"aliasga='gitadd'aliasgd='gitdiff'aliasgf='gitfetch'别名grv='gitremote-v'别名gbr='gitbranch'别名gpl="gitpull"别名gps="gitpush"别名gco="gitcheckout"别名gl="gitlog"别名gc="gitcommit-m"aliasgm="gitmerge"#Forlocalaliascd..="cd.."别名cd...="cd../.."别名cd....="cd../../.."别名..="cd.."别名...="cd../.."alias....="cd../../.."aliasip="curlip.cn"source~/.zshrc快速跳转zsh支持目录的快速跳转,我们可以使用d命令列出最近访问过的目录,然后选择目录前面的数字可以快速跳转:增加命令高亮效果命令高亮效果是当用户输入正确的命令时,命令会以绿色高亮显示,并且出错时命令红色高亮切入扩展目录cd~/.oh-my-zsh/custom/plugins执行命令将项目克隆到当前目录gitclonegit://github.com/zsh-users/zsh-syntax-highlighting.git打开`.zshrc`文件,在最后添加如下内容vim~/.zshrcaddcodesource~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zshplugins=(zsh-syntax-highlighting)保存文件执行source~/.zshrc自动提示命令切入扩展目录cd~/.oh-my-zsh/custom/plugins执行命令将项目克隆到当前目录gitclonegit://github.com/zsh-users/zsh-autosuggestions打开.zshrc文件,在末尾添加如下内容~/.oh-my-zsh/custom/plugins/zsh-autosuggestions/zsh-autosuggestions.zshplugins=(zsh-autosuggestions)保存文件。cd~/.oh-my-zsh/custom/plugins/zsh-autosuggestionsvimzsh-autosuggestions.zsh修改ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=10'source~/.zshrc更多精彩内容请关注作者博客,https://学习时间.xin