前陣子介紹了 漂漂終端機懶人包,把終端機變得美美的方法,但是其實有一個更強大的 framework 叫做 oh-my-zsh,它是一個大家可以一起編輯的 zsh framework,擁有 120+ plugins、120+ themes,所以可以跟大家分享自己的主題,或是拿別人的來用。除了主題之外,他的 plugin 強大的功能也是令大眾喜愛的原因,譬如你想要 簡寫
或 偷懶 的做某件事,如果不想要要靠 batch 檔來執行,可以用 oh-my-zsh 的 custom plugin,然後可以分享給其他人。
你應該開始使用 “OH MY ZSHELL!”
Shell? bash v.s. zsh
至於兩個 Shell 差別在哪?來看看官方 FAQ 說法:
2.5: Similarities with bash
The Bourne-Again Shell, bash
, is another enhanced Bourne-like shell; the most obvious difference from zsh
is that it does not attempt to emulate the Korn shell. Since both shells are under active development it is probably not sensible to be too specific here. Broadly, bash
has paid more attention to standards compliancy (i.e. POSIX) for longer, and has so far avoided the more abstruse interactive features (programmable completion, etc.) that zsh
has.
但我覺得差別最大的應該是 tab
鍵的應用。
Configuration Environment
- Unix-like system: OSX
- Linux: Ubuntu
Install oh-my-zsh
Step 1: github 下載 oh-my-zsh
|
|
Step 2: 設定 PATH,railscasts Oh My ZSH
|
|
Step 3: 設定 zsh vi ~/.zshrc
,下面是我目前的設定檔範例
|
|
Step 4: mac iterm2 設定 default zsh
自定義主題
主題除了在 github wiki 上挑選外,還可以查看圖示列表 http://zshthem.es/all/。而我最後挑選了 kennethreitz
作為我的主題,並且做了一些更動,以下是我的主題設定檔:
|
|
|
|
Plugin
舉一個例子我有 plugins=(sublime)
,然後來看看他的 zsh code 是怎麼寫的,然後讓我們加入幾行 code 使得可以使用 st3
來開啟最新版本的 sublime 3:
|
|
|
|
如此一來就可以透過指令來啓動 sublime囉,超級方便。
|
|