ubuntu 安装zsh oh-my-zsh oh-my-zsh-theme:powerlevel9k

此文本适用于 电脑上没有正常安装好 zsh 的情况

Zsh

如果没有安装:

https://github.com/robbyrussell/oh-my-zsh/wiki/Installing-ZSH

sudo apt install zsh

sudo apt install git-core

设置为默认终端

卸载时要先设置终端为bash

chsh -s $(which zsh)//这里可能会出错

echo $SEHLL

然后要注销一次

oh-my-zsh

官方链接:https://github.com/robbyrussell/oh-my-zsh#getting-started

推荐教程: https://gist.github.com/tsabat/1498393

核心命令:

wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh

可能碰到的问题

Down,up keys 不能调用历史命令

~/.zshrc上加上

plugins=(

git

safe-paste

)

compinit: function definition file not found

(出错的语句含有以上内容)

rm ~/.zcompdump

https://superuser.com/questions/1222867/zsh-completion-functions-broken

https://github.com/robbyrussell/oh-my-zsh/issues/4757

echo $FPATH | grep /usr/share/zsh

看看是否有内容

如果没有则添加到/.zshrc 上

fpath=(/usr/share/zsh $fpath)

如果没有/usr/share/zsh这个文件(比如我就没有),

https://github.com/zsh-users/zsh

新建一个zsh文件夹,再把其他缺少的文件夹复制到/usr/share/zsh上,比如把源代码上的functions复制到缺少的zsh/functions目录上

下面是我的echo $FPATH

   

使用powerlevel9k主题

  1. 安装一种powerline类字体

    https://github.com/bhilburn/powerlevel9k/wiki/Install-Instructions#step-2-install-a-powerline-font

    例如powerline字体

       

git clone https://github.com/powerline/fonts.git --depth=1

cd fonts

./install.sh

cd ..

rm rf fonts

   

安装powerlevel9k theme

https://github.com/bhilburn/powerlevel9k/wiki/Install-Instructions#step-1-install-powerlevel9k

   

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

/.zshrc上添加

ZSH_THEME="powerlevel9k/powerlevel9k"

DEFAULT_USER='hao'

 

猜你喜欢

转载自blog.csdn.net/migeater/article/details/79555775