centos上安装oh-my-zsh, zsh-autosuggestions, autojump, zsh-syntax-highlighting
安装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