[How to] Setup oh-my-zsh in Manjaro


#1

1.install zsh

sudo pacman -S zsh zsh-completions
cat /etc/shells
chsh -s /bin/zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

then you can start konsole and in set-edit configuration shell- routine-command,change/bin/bash to /bin/zsh
2.config zsh
(1)zsh-syntax-highlighting 语法高亮显示
Simply clone this repository and source the script:

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
echo "source ${(q-)PWD}/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/plugins/zsh-syntax-highlighting

Then, enable syntax highlighting in the current interactive shell:在zshrc文件末尾加入下面的信息用alt+.显示隐藏文件

source ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

(2)autosuggestions 自动补充
Clone this repository into $ZSH_CUSTOM/plugins (by default ~/.oh-my-zsh/custom/plugins)

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:add to ~.zshrc at end.

source ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh

3.字体配置
修改Oh-My-Zsh agnoster匹配字体

显示效果中有乱码,这是因为字体没适配。我们需要下载支持Powerline的字体。

下载地址:https://github.com/powerline/fonts
下载完成双击安装,注意:字体安装请选用个人不要安装到系统。

默认Ubuntu 终端使用的是 Ubuntu mono regular字体 13字号
4.修改主题
Oh-My-Zsh的默认配置文件在:~/.zshrc
编辑~/.zshrc修改主题为:agnoster。修改为ZSH_THEME="agnoster"
主题进一步优化
精简 user@hostname:添加export DEFAULT_USER="username"到~/.zshrc中,可以隐藏固定的 user@hostname 信息。


#2

Since I don’t see a question there, I suspect you intended this for the Tutorial section.

If so, I would clean up the formatting a bit, and move it to tutorials.


#3

If you want an easy zsh config, I would like to recommend the manjaro-zsh-config package. It is excellent.
sudo pacman -S manjaro-zsh-config


#4

Another easy option is zim:

It is much faster than oh-my-zsh.


Zsh config like fish
#5

There is already a great tutorial here about oh-my-zsh.


#6

oh,yes this is a good idea!! Thanks.


#7

I post this for using zsh. So move it to tutorials


#8

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.