強大的虛擬終端zsh以及oh my zsh管理框架

什么是zsh

ZSH也稱為Z Shell,是Bourne Shell(sh)的擴展版本岛心,具有許多新功能琳钉,并支持插件和主題舀患。 由于ZSH與Bash基于相同的外殼,因此ZSH具有許多相同的功能,并且切換起來非常容易。

zsh的安裝

  • ubantu20.04下安裝非常容易董济,直接apt install即可,然后查看系統(tǒng)中的全部shell中出現(xiàn)zsh代表安裝成功
jiahui@ubuntu:~$ sudo apt install zsh

jiahui@ubuntu:~$ zsh --version
zsh 5.8 (x86_64-ubuntu-linux-gnu)

jiahui@ubuntu:~$ cat /etc/shells 
/bin/sh
/bin/bash
/bin/rbash
/bin/dash
/bin/zsh
/usr/bin/zsh
  • 設(shè)置zsh為默認(rèn)的shell
jiahui@ubuntu:~$ chsh -s /bin/zsh 
jiahui@ubuntu:~$ reboot 
  • 查看是否已經(jīng)設(shè)置稱為默認(rèn)的shell
jiahui@ubuntu:~$ echo $SHELL
/bin/zsh

什么是 oh my zsh

打開oh my zsh的官網(wǎng),如同官網(wǎng)所說要门,Oh My Zsh是一開源的虏肾,社區(qū)驅(qū)動的框架,用于管理欢搜。

oh my zsh的安裝

jiahui@ubuntu:~$ sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

相關(guān)的插件安裝

打開配置文件封豪,添加想要的插件,就可以進行相關(guān)插件的安裝了

 ~ sudo gedit ~/.zshrc
  • 插件設(shè)置
# Which plugins would you like to load?
# Standard plugins can be found in $ZSH/plugins/
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git)

保存退出后在終端輸入

source ~/.zshrc 

插件概述

Plugins Overview有相關(guān)的概述

插件推薦

分享出自己的plugins的設(shè)置

plugins=(
git #extras: git-extras gitfast git-flow git-flow-avh git-hubflow git-remote-branch
extract #'x' alias - swiss knife for archive extracting
z #yet another autojump
history #aliases: h for history, hsi for grepping history
rand-quote #quote function for random quotes from [https://www.quotationspage.com/random.php](https://www.quotationspage.com/random.php)
themes #ZSH theme switcher
cp #cp with progress bar (rsync)
colored-man-pages #adds colors to manpages
battery #allows see battery status in PS

# The following plug-ins need to be installed separately. Clone the corresponding git repository to the corresponding directory: ~/.oh-my-zsh/custom/plugins
zsh-syntax-highlighting #Fish shell-like syntax highlighting for Zsh(https://github.com/zsh-users/zsh-syntax-highlighting)
zsh-autosuggestions #It suggests commands as you type based on history and completions (https://github.com/zsh-users/zsh-autosuggestions)
git-open #Type git open to open the repo website (GitHub, GitLab, Bitbucket) in your browser.(https://github.com/paulirish/git-open)
)

部分插件需要單獨下載到 ~/.oh-my-zsh/custom/plugins目錄下


相關(guān)主題的設(shè)置

# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
ZSH_THEME="powerlevel10k/powerlevel10k"

相關(guān)主題的安裝

要說到什么主題最好用炒瘟,那當(dāng)然是powerlevel10k吹埠。先來上一張主題的照片

安裝方法,參照官網(wǎng)提示:

  1. 安裝推薦的字體疮装,可選缘琅,但強烈建議。
  1. 安裝Powerlevel10k
  • 將倉庫克隆到~/.oh-my-zsh/custom/themes
╭─ ?  ?  ~/.oh-my-zsh/custom/themes on ?  ? master                                                                           at ?  14:47:39 ─╮
╰─? git clone https://github.com/romkatv/powerlevel10k.git 
  • 修改zshrc配置文件
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
ZSH_THEME="powerlevel10k/powerlevel10k"
  1. 使用exec Zsh重新啟動Zsh
╭─ ?  ?  ~/.oh-my-zsh/custom/themes on ?  ? master                                                                     ? INT at ?  14:49:14 ─╮
╰─? exec zsh  
  1. 如果配置向?qū)]有自動啟動樊展,請鍵入p10k configure
╭─ ?  ?  ~/.oh-my-zsh/custom/themes on ?  ? master                                                                     ? INT at ?  14:52:43 ─╮
╰─? p10k configure 
  1. 按照對應(yīng)的配置向?qū)Ъ纯赏瓿蓪僮约旱闹黝}配置呻纹,如果覺得不好,請鍵入p10k configure重新配置

卸載

uninstall_oh_my_zsh
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末专缠,一起剝皮案震驚了整個濱河市雷酪,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌藤肢,老刑警劉巖太闺,帶你破解...
    沈念sama閱讀 216,919評論 6 502
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件糯景,死亡現(xiàn)場離奇詭異嘁圈,居然都是意外死亡省骂,警方通過查閱死者的電腦和手機,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,567評論 3 392
  • 文/潘曉璐 我一進店門最住,熙熙樓的掌柜王于貴愁眉苦臉地迎上來钞澳,“玉大人,你說我怎么就攤上這事涨缚≡冢” “怎么了?”我有些...
    開封第一講書人閱讀 163,316評論 0 353
  • 文/不壞的土叔 我叫張陵脓魏,是天一觀的道長兰吟。 經(jīng)常有香客問我,道長茂翔,這世上最難降的妖魔是什么混蔼? 我笑而不...
    開封第一講書人閱讀 58,294評論 1 292
  • 正文 為了忘掉前任,我火速辦了婚禮珊燎,結(jié)果婚禮上惭嚣,老公的妹妹穿的比我還像新娘。我一直安慰自己悔政,他們只是感情好晚吞,可當(dāng)我...
    茶點故事閱讀 67,318評論 6 390
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著谋国,像睡著了一般槽地。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上芦瘾,一...
    開封第一講書人閱讀 51,245評論 1 299
  • 那天闷盔,我揣著相機與錄音,去河邊找鬼旅急。 笑死逢勾,一個胖子當(dāng)著我的面吹牛,可吹牛的內(nèi)容都是我干的藐吮。 我是一名探鬼主播溺拱,決...
    沈念sama閱讀 40,120評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼谣辞!你這毒婦竟也來了迫摔?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 38,964評論 0 275
  • 序言:老撾萬榮一對情侶失蹤泥从,失蹤者是張志新(化名)和其女友劉穎句占,沒想到半個月后,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體躯嫉,經(jīng)...
    沈念sama閱讀 45,376評論 1 313
  • 正文 獨居荒郊野嶺守林人離奇死亡纱烘,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 37,592評論 2 333
  • 正文 我和宋清朗相戀三年杨拐,在試婚紗的時候發(fā)現(xiàn)自己被綠了。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片擂啥。...
    茶點故事閱讀 39,764評論 1 348
  • 序言:一個原本活蹦亂跳的男人離奇死亡哄陶,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出哺壶,到底是詐尸還是另有隱情屋吨,我是刑警寧澤,帶...
    沈念sama閱讀 35,460評論 5 344
  • 正文 年R本政府宣布山宾,位于F島的核電站至扰,受9級特大地震影響,放射性物質(zhì)發(fā)生泄漏资锰。R本人自食惡果不足惜渊胸,卻給世界環(huán)境...
    茶點故事閱讀 41,070評論 3 327
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望台妆。 院中可真熱鬧翎猛,春花似錦、人聲如沸接剩。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,697評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽懊缺。三九已至疫稿,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間鹃两,已是汗流浹背遗座。 一陣腳步聲響...
    開封第一講書人閱讀 32,846評論 1 269
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留俊扳,地道東北人途蒋。 一個月前我還...
    沈念sama閱讀 47,819評論 2 370
  • 正文 我出身青樓,卻偏偏與公主長得像馋记,于是被迫代替她去往敵國和親号坡。 傳聞我的和親對象是個殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點故事閱讀 44,665評論 2 354

推薦閱讀更多精彩內(nèi)容