0%

Ubuntu 安装 oh-my-zsh、autojump 和 autosuggestions

每次重装系统都会重新百度怎么安装 oh-my-zsh 索性记录下来

zsh

1
sudo apt-get install zsh

oh-my-zsh

1
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"

替换自己默认的 bash

1
vim /etc/passwd

“taseikyo:x:1000:1000::/home/taseikyo:/bin/bash” → “taseikyo:x:1000:1000::/home/taseikyo:/bin/zsh”

修改主题

上面连接中给了很多主题,但是我习惯了 agnoster

1
vim ~/.zshrc

修改 “ZSH_THEME” 为 “agnoster”

退出重新登录就好了

autojump

当你习惯了 autojump 操作之后,没了它就会觉得十分别扭

1
sudo apt-get install autojump

在 zsh 的配置文件中加上 . /usr/share/autojump/autojump.sh

最后 source ~/.zshrc 大功告成!

哦对了,记得把 alias gs="git status" 也写入配置文件。

autosuggestions

自动补全命令的功能也是必不可少的。

  1. 将该插件到 .oh-my-zsh 的插件目录
1
git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
  1. 启用该插件

编辑配置文件,找到 “plugins=(git)” 并修改为 “plugins=(git zsh-autosuggestions)”
然后 source 配置文件即可。

Welcome to my other publishing channels