Ubuntu终端美化:oh-my-zsh+Powerlevel9k

1.zsh

zsh 是一款功能强大终端(shell)软件,既可以作为一个交互式终端,也可以作为一个脚本解释器。它在兼容 Bash 的同时 (默认不兼容,除非设置成 emulate sh) 还有提供了很多改进,例如:

  • 更高效
  • 更好的自动补全
  • 更好的文件名展开(通配符展开)
  • 更好的数组处理
  • 可定制性高

2.oh-my-zsh

目前常用的 Linux 系统和 OS X 系统的默认 Shell 都是 bash,但是真正强大的 Shell 是深藏不露的 zsh, 这货绝对是马车中的跑车,跑车中的飞行车,史称『终极 Shell』,但是由于配置过于复杂,所以初期无人问津,很多人跑过来看看 zsh 的配置指南,什么都不说转身就走了。直到有一天,国外有个穷极无聊的程序员开发出了一个能够让你快速上手的zsh项目,叫做「oh my zsh」,Github 网址是:https://github.com/robbyrussell/oh-my-zsh 这玩意就像「X天叫你学会 C++」系列,可以让你神功速成,而且是真的。

3.Powerlevel9k

Powerlevel9k是一个oh-my-zsh主题,可以用来创建非常有用和美观的终端环境。

4.autojump

autojump一键直达目录,用于快速切换目录。只要你记得目录的模糊的名字,就可以使用命令j 目录名字来一键跳转到指定目录,而不用一遍又一遍重复“cd ls cd ls cd ls ……”。

5.zsh-syntax-highlighting

zsh-syntax-highlighting高亮你的zsh可用命令.。

6.zsh-autosuggestions

zsh-autosuggestions终端自动提示插件

安装

1.安装oh-my-zsh

 
  1. # 安装zsh
  2. apt-get install zsh -y
  3.  
  4. # 修改shell为zsh
  5. chsh -s /bin/zsh
  6.  
  7. # 安装oh-my-zsh
  8. wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh

2.安装并配置autojump

 
  1. apt-get install autojump -y
  2. echo '. /usr/share/autojump/autojump.sh'>>~/.zshrc

3.设置默认shell为zsh

 
  1. chsh -s /bin/zsh

配置完成后重启终端。

4.安装Powerline字体

Github:https://github.com/powerline/fonts

 
  1. # clone
  2. git clone https://github.com/powerline/fonts.git
  3. # install
  4. cd fonts
  5. ./install.sh

5.设置终端字体

打开终端菜单:Edit > Profile Preferences
General选项卡,勾选Custom font,自定义字体,选择字体为Meslo LG L DZ for Powerline Regular

6.安装Powerlevel9k

Github:https://github.com/bhilburn/powerlevel9k
To install this theme for use in Oh-My-Zsh, clone this repository into your OMZ custom/themes directory.

 
  1. git clone https://github.com/bhilburn/powerlevel9k.git ~/.oh-my-zsh/custom/themes/powerlevel9k

You then need to select this theme in your ~/.zshrc:

 
  1. ZSH_THEME="powerlevel9k/powerlevel9k"

7.安装zsh-syntax-highlighting

Github:https://github.com/zsh-users/zsh-syntax-highlighting

Clone this repository in oh-my-zsh’s plugins directory:

 
  1. git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

Activate the plugin in~/.zshrc:

 
  1. plugins=( [plugins...] zsh-syntax-highlighting)

Source ~/.zshrc to take changes into account:

 
  1. source ~/.zshrc

8. 安装zsh-autosuggestions

Github:https://github.com/zsh-users/zsh-autosuggestions#oh-my-zsh

Clone this repository into $ZSH_CUSTOM/plugins (by default ~/.oh-my-zsh/custom/plugins)

 
  1. git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions

Add the plugin to the list of plugins for Oh My Zsh to load:

 
  1. plugins=( [plugins...] zsh-autosuggestions)

最后重启终端,查看效果。

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值