安裝oh-my-zsh
oh-my-zsh依賴於zsh,需要先安裝zsh
yum install zsh
如果當前的shell不是zsh,輸入chsh后,輸入/bin/zsh,回車
yum install git
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
或者
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" //可能已不能用了。
安裝zsh-autosuggestions
git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
在.zshrc中plugins增加zsh-autosuggestions,
在.zshrc中加入下面一行內容,使用逗號就可以自動補全
bindkey ',' autosuggest-accept
source ~/.zshrc
安裝autojump
git clone https://github.com/joelthelion/autojump.git
直接切換至autojump目錄./install.py
(如果這里沒裝python要裝,不過貌似現在都帶的)裝完會有帶下面的這種提示復制至 ./zshrc中 我是放在plugins下面的
[[ -s ~/.autojump/etc/profile.d/autojump.sh ]] &;&; . ~/.autojump/etc/profile.d/autojump.sh (有可能不一樣,就像我家腐竹長樹上一樣)
這個也需要添加至plugins
source ~/.zshrc
ubuntu下,推薦用下面的方式。
Autojump – Linux 文件系統導航的最快方式
Autojump 應用可以從用戶那里學習並幫助用戶在 Linux 命令行中進行更輕松的目錄導航。與傳統的 cd 命令相比,autojump 能夠更加快速地導航至目的目錄。
注意:需要最新版的Python做支持
先升級下系統保證是最新版的Python
apt-get update && apt-get upgrade && apt-get dist-upgrade
然后 安裝autojump
apt-get install autojump
安裝完成后要有一些配置 才能使用 autojump。為了暫時激活 autojump 應用,即直到你關閉當前會話或打開一個新的會話之前讓 autojump 均有效,你需要以常規用戶身份運行下面的命令:
source /usr/share/autojump/autojump.sh on startup
為了使得 autojump 在 BASH shell 中永久有效,你需要運行下面的命令:
echo '. /usr/share/autojump/autojump.zsh'>>~/.bashrc
然后就可以愉快的使用 j 命令去跳轉目錄了。前提是你有cd 過的目錄才能跳轉喲!
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
添加至plugins
source ~/.zshrc
2019-01-28
=====================================
離線安裝
1 下載 https://github.com/ohmyzsh/ohmyzsh/
2 解壓后mv ohmyzsh-master .oh-my-zsh
3 https://blog.csdn.net/u012814856/article/details/100668640
主要是刪除setup_ohmyzsh 函數
4 sh install.sh
5 source ~/.zshrc