ubunut 16.04安装oh-my-zsh和zsh-autosuggestions

网友投稿 292 2022-08-25

ubunut 16.04安装oh-my-zsh和zsh-autosuggestions

zsh是一个类似余linux上原生bash shell的一个shell,是原生的bash shell的拓展,我们在敲击命令的时候,历史命令都会经常的被用到,如果terminal能够提示,就大大减少了我们的敲击历史命令的时间了,这样能够提高效率,但是原生的shell并没有提供这种功能,我这里用zsh解决。

1. oh-my-zsh安装

sudo apt-get updatesudo apt-get install zshsh -c "$(wget -O -)"

然后termianl关闭,然后重新登陆就可以启用zsh啦

2.zsh-autosuggestions安装

这个也很简单

git clone ~/.zsh/zsh-autosuggestionssource ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh

然后你会惊奇的发现,你在敲击一些命令的时候,会自动提示你的历史命令,是不是很好用。zsh的更多功能,请参考我的参考文献哈。

但是这样重新打开terminal的时候,你会发现没有提示了,这个时候我们需要在zshrc中加入source操作

vim ~/.zshrc找个空地方把下面的配置添加上去# Load zsh-autosuggestions.source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh

:wq保存退出,然后重新打开的时候就可以自动提示了

我的zshrc文件配置为:

# If you come from bash you might have to change your $PATH.# export PATH=$HOME/bin:/usr/local/bin:$PATH# Path to your oh-my-zsh installation. export ZSH="/home/wu/.oh-my-zsh"# 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 git)# Load zsh-autosuggestions.source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zshsource $ZSH/oh-my-zsh.sh# User configuration# export MANPATH="/usr/local/man:$MANPATH"# You may need to manually set your language environment# export LANG=en_US.UTF-8# Preferred editor for local and remote sessions# if [[ -n $SSH_CONNECTION ]]; then# export EDITOR='vim'# else# export EDITOR='mvim'# fi# Compilation flags# export ARCHFLAGS="-arch x86_64"# ssh# export SSH_KEY_PATH="~/.ssh/rsa_id"# Set personal aliases, overriding those provided by oh-my-zsh libs,# plugins, and themes. Aliases can be placed here, though oh-my-zsh# users are encouraged to define aliases within the ZSH_CUSTOM folder.# For a full list of active aliases, run `alias`.## Example aliases# alias zshconfig="mate ~/.zshrc"# alias ohmyzsh="mate ~/.oh-my-zsh"

参考文献

[1].zsh-autosuggestions.​​My ZSH.​​https://ohmyz.sh/​​

[3].终端自动提示插件的安装​

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:移动互联时代,传统制造业老板做品牌营销的正确姿势 !(互联网时代如何塑造品牌)
下一篇:mac python把mp3转换为wav文件
相关文章

 发表评论

暂时没有评论,来抢沙发吧~