oh my zsh 主题配置哪些主题比较好看,有特点

macOS利用zsh和oh-my-zsh来提高效率 - 今日头条()
macOS利用zsh和oh-my-zsh来提高效率
本文通过介绍使用 zsh 搭配 oh-my-zsh 来提高工作效率。开始使用Term2和大多数Linux发行版一样,macOS的系统默认终端不是很好用,诸如快捷键、快捷操作方式等等都不是特别的如意,我们选择 iTerm2 来替代系统默认的 Terminal。 iTerm2 提供了包括分屏、自定义颜色方案、粘贴历史记录、高级自定义组合键,在你追求一定效率的情况下,这些东西很好用。安装 ZSH + oh-my-zsh很多系统的默认终端是 bash,他是当前最流行的默认 shell ,几乎全部的 Linux 发行版都默认安装了 bash。但是有很多 bash 兼容替代方案,比如 fish 、 zsh,帮助开发组提供快捷的使用。我们介绍使用 zsh,全城是 Z-shell。和他搭配使用的 Oh-My-Zsh,是一个配置管理框架。 这个框架安装非常方便:curl -L /robbyrussell/oh-my-zsh/master/tools/install.sh | sh安装后使用zsh需要手工执行 zsh,如果需要设置为默认的shell,还需要用个命令chsh -s $(which zsh)ZSH主题Oh-My-Zsh 默认有非常多的主题,我目前使用的是 robbyrussell :这些主题大家可以根据自己喜好随意更换。当然,默认的主题就很好看:更换的方式是这样配置,修改 ~/.zshrc 里面的 ZSH_THEME 即可。
想你所想,需你所需,最新鲜刺激的资讯,最对味对体的信息。
违法和不良信息举报电话:010-
公司名称:北京字节跳动科技有限公司安装 oh-my-zsh 遇到的问题 - 简书
下载简书移动应用
写了478字,被3人关注,获得了9个喜欢
安装 oh-my-zsh 遇到的问题
1.首先遇到的是无法找到 oh-my-zsh 的文件目录地址,最后发现是在/Users/xxx/.dotfiles/zsh。
目录文件地址
2.无法更新 oh-my-zsh,通过修改zsh/tools/upgrade.sh 文件,删除--rebase修改为:if git pull
origin master。
修改后示意图
如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
打开微信“扫一扫”,打开网页后点击屏幕右上角分享按钮
被以下专题收入,发现更多相似内容:
优雅的Mac需要优雅的使用, 收集更多的Mac优雅使用指南
推荐文章和系列阅读:
1. Mac优雅使用指南——一个码字民工...
· 14514人关注
Write the Code, Change the World, 改变世界从编程开始, 收集编程相关的干货
· 11785人关注
绝对关你事!
· 2831人关注
如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
选择支付方式:工具技巧(19)
一直以來看到很多人推薦用 zsh (z shell),原因就不贅述了,簡單講就是更好用、更炫 (?)。今天花了一些時間從 bash 轉移到 zsh,過程中遇到一些小問題讓我卡了幾次小關,這篇主要是分享我遇到的狀況,有興趣裝 zsh 的人如果遇到類似問題可以參考看看。
這邊講 MAC 的安裝方法,不過 Linux 也差不多就是了。簡單來說,共有四個步驟:
安裝&zsh安裝&oh-my-zsh安裝&zsh-completions調整設定
第2步安裝的&&是一套 zsh 的 framework,內建了非常多實用的設定、plugin、alias、theme...等等,可以讓剛跳到 zsh 的使用者大幅降低轉換和設定的成本,幾乎是達到了免設定就能非常好用的境界。從 google 趨勢搜尋可以看出 2011 年 oh-my-zsh 出現在
google 趨勢搜尋以後,,所以 zsh 最近能越來越紅我想 oh-my-zsh 功不可沒。總之強烈建議要玩 zsh 的話記得一起安裝 oh-my-zsh!
不過即使 oh-my-zsh 再好用,還是有一些自動補全的功能沒有包含在裡面。例如說如果你在 bash 底下有安裝&bash-completion,會發現你用 homebrew 再按下 tab 時可以自動補全套件的名稱,像是這樣:
$ brew search z
這時按下&tab&鍵,會自動show出所有z開頭的套件:
$ brew search z
zsh-completions
zsh-history-substring-search
zsh-lovers
zsh-syntax-highlighting
類似的 homebrew 補全功能在 oh-my-zsh 是沒有納入的,所以需要透過自行撰寫,或者利用類似&zsh-completions&這樣的套件來補足。
$ brew install zsh
然後記得修改預設的 shell 為 zsh ,這樣子以後開一個新的 shell 就都會是使用 zsh 了:
$ chsh -s /usr/local/bin/zsh
安裝 on-my-zsh
$ git clone git:///robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
預設安裝路徑是&~/.oh-my-zsh,如果想裝在別的地方記得記得修改&~/.zshrc。
zsh 的設定檔放在&~/.zshrc,這個檔案需要我們自己產生。由於我們用 oh-my-zsh,所以這邊建議使用 oh-my-zsh 預設的 templete 比較省事:
$ cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
安裝 zsh-completions
$ brew install zsh-completions
要啟用還需要打開你的&.zshrc&加入以下兩行來納入 zsh-completions 的補全功能:
@@ -1,8 +1,11 @@
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
+# zsh-completions
+fpath=(/usr/local/share/zsh-completions $fpath)
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to &random&, it'll load a random theme each
# time that oh-my-zsh is loaded.
#ZSH_THEME=&robbyrussell&
同時還需要 rebuild zsh 的&.zcompdump
$ rm -f ~/. compinit
這樣子就搞定了
經過以上的安裝,已經可以做一些基本的使用了(也很好用了),不過 oh-my-zsh 內建很多 theme 還有好用的 plugin,需要透過手動啟用。
1. 切換 theme
所有的主題都放在&~/.oh-my-zsh/themes&目錄中,先看一下有哪些可以用:
$ ls ~/.oh-my-zsh/themes
3den.zsh-theme
fwalch.zsh-theme
nanotech.zsh-theme
Soliah.zsh-theme
gallifrey.zsh-theme
nebirhos.zsh-theme
adben.zsh-theme
gallois.zsh-theme
nicoulaj.zsh-theme
af-magic.zsh-theme
garyblessington.zsh-theme
norm.zsh-theme
afowler.zsh-theme
gentoo.zsh-theme
obraun.zsh-theme
agnoster.zsh-theme
geoffgarside.zsh-theme
peepcode.zsh-theme
alanpeabody.zsh-theme
gianu.zsh-theme
philips.zsh-theme
amuse.zsh-theme
gnzh.zsh-theme
pmcgee.zsh-theme
apple.zsh-theme
gozilla.zsh-theme
pure.zsh-theme
arrow.zsh-theme
half-life.zsh-theme
pygmalion.zsh-theme
aussiegeek.zsh-theme
humza.zsh-theme
re5et.zsh-theme
avit.zsh-theme
imajes.zsh-theme
rgm.zsh-theme
awesomepanda.zsh-theme
intheloop.zsh-theme
risto.zsh-theme
bira.zsh-theme
itchy.zsh-theme
rixius.zsh-theme
blinks.zsh-theme
jaischeema.zsh-theme
rkj-repos.zsh-theme
bureau.zsh-theme
jbergantine.zsh-theme
rkj.zsh-theme
candy-kingdom.zsh-theme
jispwoso.zsh-theme
robbyrussell.zsh-theme
candy.zsh-theme
jnrowe.zsh-theme
sammy.zsh-theme
切換方式是修改&.zshrc&的&ZSH_THEME&這個參數,預設是&robbyrussell,如果想改成&apple.zsh-theme,那麼請把&ZSH_THEME&改為&apple:
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to &random&, it'll load a random theme each
# time that oh-my-zsh is loaded.
-ZSH_THEME=&robbyrussell&
+ZSH_THEME=&apple&
改完後,重新登入看看,應該就可以發現你的 shell 長得不一樣了。
,如果不想一個一個試來看效果,可以參考看看。
2. 啟用 plugin
oh-my-zsh 內建的 plugin 都放在&~/.oh-my-zsh/plugins:
$ ls ~/.oh-my-zsh/plugins
apache2-macports
rand-quote
啟用 plugin 一樣是在&.zshrc&中做設定,預設的設定只啟用了 git 的 plugin,如下:
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
plugins=(git)
要啟用某個 plugin,就只要加在括號裡即可,比如說想要用 heroku 的 plugin,請把 .zshrc 改成:
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
-plugins=(git)
+plugins=(git heroku)
至於這麼多 plugin 分別有什麼用途,以後有空再介紹....
轉換過程中可能遇到的一些問題
如果你本來就有設定一些 alias 在你的&.bashrc,你又把這些設定直接套用到&.zshrc,那有機會有一些指令會變怪怪的,這有可能是你設定的
alias 與 oh-my-zsh 內建的衝到了。oh-my-zsh 內建的 alias 放在&~/.oh-my-zsh/lib/aliases.zsh,內容如下:
aliases.zsh
# Push and pop directories on directory stack
alias pu='pushd'
alias po='popd'
# Basic directory operations
alias ...='cd ../..'
alias -- -='cd -'
# Super user
alias _='sudo'
alias please='sudo'
#alias g='grep -in'
# Show history
if [ &$HIST_STAMPS& = &mm/dd/yyyy& ]
alias history='fc -fl 1'
elif [ &$HIST_STAMPS& = &dd.mm.yyyy& ]
alias history='fc -El 1'
elif [ &$HIST_STAMPS& = &yyyy-mm-dd& ]
alias history='fc -il 1'
alias history='fc -l 1'
# List direcory contents
alias lsa='ls -lah'
alias l='ls -la'
alias ll='ls -l'
alias la='ls -lA'
alias sl=ls # often screw this up
alias afind='ack-grep -il'
建議要在&.zshrc&加上自己的 alias 前先確認看看這個檔案裡是不是有一些 alias 會跟你的衝到。
2. bash-completion
如果你跟我一樣用 bash 時有裝 bash-completion,而且又沒仔細弄清楚就把&.bashrc&的內容一股腦套用在&.zshrc&上,那麼當你開一個新的
shell 時有可能會發現遇到以下的訊息:
/usr/local/etc/bash_completion:138: command not found: complete
/usr/local/etc/bash_completion:141: command not found: complete
/usr/local/etc/bash_completion:144: command not found: complete
/usr/local/etc/bash_completion:147: command not found: complete
/usr/local/etc/bash_completion:150: command not found: complete
/usr/local/etc/bash_completion:153: command not found: complete
/usr/local/etc/bash_completion:156: command not found: complete
/usr/local/etc/bash_completion:159: command not found: complete
/usr/local/etc/bash_completion:162: command not found: complete
/usr/local/etc/bash_completion:246: parse error near `]]'
這是因為在安裝 bash-completion 的時候,原則上都會加入以下內容在你的&.bashrc:
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
以上指令會去source&bash_completion&的內容,而 bash_completion 裡面使用了&中的&complete&這個指令,所以如果你的 .zshrc 也去 source bash_completion,那就會show出像上面的&command
not found: complete&這種訊息了。所以記得在 .zshrc 中不要加入這段 code。
趕快一起來用 zsh 吧!
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:43598次
积分:1387
积分:1387
排名:千里之外
原创:74篇
转载:125篇
评论:19条
(15)(1)(2)(1)(5)(3)(5)(1)(3)(4)(3)(2)(22)(17)(7)(9)(8)(2)(18)(2)(31)(11)(27)(1)(1)(1)将oh-my-zsh变成真正的my zsh_Linux教程_Linux公社-Linux系统门户网站
你好,游客
将oh-my-zsh变成真正的my zsh
来源:Linux社区&
作者:CherishFX
oh-my-zsh安装:
1.安装zsh: sudo apt-get install zsh
2.将当前用户的shell环境修改为zsh:& chsh -s /bin/zsh
若用chsh命令修改无效,则进入/etc/passwd中修改当前用户的shell环境。
3.安装oh-my-zsh【参考:/robbyrussell/oh-my-zsh】
3.1安装git: sudo apt-get install git
3.2安装curl: sudo apt-get install curl
3.2安装oh-my-zsh
自动安装:
curl -L /robbyrussell/oh-my-zsh/master/tools/install.sh | sh
默认安装路径为:~/.oh-my-zsh
手动安装:
git clone git:///robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
4.重启:sudo reboot
然后就可以看到oh-my-zsh生效。
Zsh安装配置指南
使用 Zsh 的九个理由
Zsh使用心得三则
Linux下安装终极Shell Zsh
本文永久更新链接地址:
相关资讯 & & &
& (06月07日)
& (12/18/:35)
& (05/26/:02)
& (01月25日)
& (09/05/:23)
& (09/21/:28)
   同意评论声明
   发表
尊重网上道德,遵守中华人民共和国的各项有关法律法规
承担一切因您的行为而直接或间接导致的民事或刑事法律责任
本站管理人员有权保留或删除其管辖留言中的任意内容
本站有权在网站内转载或引用您的评论
参与本评论即表明您已经阅读并接受上述条款}

我要回帖

更多关于 oh my zsh 切换主题 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信