哎,一年換了個(gè)21-inch iMac,兩個(gè)27-inch iMac,加上重做系統(tǒng)就更不說(shuō)了,每次都要下載各種軟件,各種配置。。。故記錄這篇文章以免自己以后老了記不住,希望可以幫到更多人吧!
效率神器Alfred、Go2shell
首先,拿到新電腦,需要下載很多軟件,第一時(shí)間把Alfred
和Go2shell
安裝好,這里有各種破解軟件免費(fèi)下載平臺(tái),里面安裝教程很詳細(xì),默認(rèn)alt + 空格
打開Alfred,Go2shell就是可以快速打開當(dāng)前路徑的終端,用起來(lái)還是很方便的。
終端配置
接下來(lái)根據(jù)個(gè)人喜好配置終端,之前也一直在用蘋果自帶的終端,但是自從接觸了iTerm2后就無(wú)法自拔了。
安裝iTerm2
先去官網(wǎng)下載iTerm2,iTerm2下載地址:https://www.iterm2.com/downloads.html配置iTerm2
目前iTerm2 最常用的主題是Solarized Dark theme
,下載地址:http://ethanschoonover.com/solarized,下載好的壓縮文件解壓后,打開 iTerm2的Preferences
配置界面,可以按Command + ,
鍵打開 ,然后Profiles -> Colors -> Color Presets -> Import
選擇剛才解壓的solarized->iterm2-colors-solarized->Solarized Dark.itermcolors文件,導(dǎo)入成功,最后選擇 Solarized Dark 主題。
配置Oh My Zsh
一款用于管理zsh配置,可以提供超級(jí)多而強(qiáng)大的插件和漂亮的主題。可以去GitHub下載Oh My Zsh
- 安裝Oh My Zsh
// 使用 crul 安裝:
$ sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
或者
// 使用wget:
$ sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
安裝成功后
- 卸載Oh My Zsh
// 卸載oh-my-zsh命令:
$ uninstall_oh_my_zsh
- 設(shè)置當(dāng)前用戶的默認(rèn)Shell為Zsh
$ chsh -s /bin/zsh
接下來(lái),將主題配置修改為ZSH_THEME="agnoster"
$ vim ~/.zshrc
到目前為止,不出意外的話,iTerm2外觀應(yīng)該是這樣的
界面顯示亂碼原因是沒有安裝Meslo
字體,字體下載地址:Meslo LG M Regular for Powerline.ttf,下載后安裝接下來(lái)還是打開 iTerm2的Preferences 配置界面,可以按Command + ,
鍵打開 ,然后Profiles -> Text -> Font -> Chanage Font
成功后的截圖
也可以修改合適的字體大小。
自動(dòng)填充
這個(gè)功能是非常實(shí)用的,可以方便我們快速的敲命令。
配置步驟,先克隆zsh-autosuggestions
項(xiàng)目,到指定目錄:
$ git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
然后編輯vim ~/.zshrc
文件,找到plugins
配置,增加zsh-autosuggestions
插件。如果配置不生效增加zsh-syntax-highlighting插件試試。
隱藏用戶名和主機(jī)名
進(jìn)入Oh My Zsh主題文件列表
$ cd ~/.oh-my-zsh/themes
進(jìn)入已選的主題,并找到prompt_context
,然后進(jìn)行修改
### Prompt components
# Each component will draw itself, and hide itself if no information needs to be shown
# Context: user@hostname (who am I and where am I)
prompt_context() {
if [[ "$USER" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then
# prompt_segment black default "%(!.%{%F{yellow}%}.)%n@%m"
prompt_segment black default "Vincent" // Vincent是寫死的名字 可以根據(jù)個(gè)人愛好隨意設(shè)置
fi
}
還有一些插件和功能網(wǎng)上很多,暫不做更多介紹。
該文章為記錄本人的電腦配置,希望能夠幫助大家,如有問題歡迎大家留言交流!!!文章地址:http://www.lxweimin.com/p/2956ec39ec8b