zsh配置

原本用WindTerm+bash,WindTerm提供了高亮、自动记忆补全等功能,基本上也够用。WindTerm还是比较早期阶段,功能细节上还有待完善,稳定性方面也有些小问题。比如用vi或者一些文本操作界面的程序时界面可能会显示乱掉;查看日志等文本文件,有些不能正常显示的字符会导致界面显示乱码,需要重新进入才能恢复。仍然非常推荐WindTerm。

Terminator供强大,也很稳定,只是界面上不如WindTerm好看、好用(文本高亮在开发中有助于提高效率)。期待WindTerm尽快完善,WindTerm+zsh让shell使用体验更上一个台阶。

zsh的可扩展性好很多,有很多现成的配置插件,也可以把bash上原有的自定义配置直接平移过来,在.zshrc中source原有的自定义设置,source ~/.bash_aliases(如果是source ~/.bashrc,需要注意避免可能冲突。在bash中我把所有自定义变量都放到.bash_aliases中,这个文件会被.bashrc自动加载。把.bash_aliases保存下来,每次重装系统直接复制过来就可以了。)

安装zsh

sudo apt-get install zsh

安装几个常用插件

git clone https://github.com/zsh-users/zsh-autosuggestions.git ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting\n

git clone https://github.com/joelthelion/autojump.git $ZSH_CUSTOM/plugins/autojump\n
cd .oh-my-zsh/custom/plugins/autojump/install.py
./install.py 
Installing autojump to /home/dev/.autojump ...
creating directory: /home/dev/.autojump/bin
creating directory: /home/dev/.autojump/share/man/man1
creating directory: /home/dev/.autojump/etc/profile.d
creating directory: /home/dev/.autojump/share/autojump
copying file: ./bin/autojump -> /home/dev/.autojump/bin
copying file: ./bin/autojump_argparse.py -> /home/dev/.autojump/bin
copying file: ./bin/autojump_data.py -> /home/dev/.autojump/bin
copying file: ./bin/autojump_match.py -> /home/dev/.autojump/bin
copying file: ./bin/autojump_utils.py -> /home/dev/.autojump/bin
copying file: ./bin/icon.png -> /home/dev/.autojump/share/autojump
copying file: ./docs/autojump.1 -> /home/dev/.autojump/share/man/man1
creating directory: /home/dev/.autojump/etc/profile.d
creating directory: /home/dev/.autojump/share/autojump
creating directory: /home/dev/.autojump/functions
copying file: ./bin/autojump.sh -> /home/dev/.autojump/etc/profile.d
copying file: ./bin/autojump.bash -> /home/dev/.autojump/share/autojump
copying file: ./bin/autojump.fish -> /home/dev/.autojump/share/autojump
copying file: ./bin/autojump.zsh -> /home/dev/.autojump/share/autojump
copying file: ./bin/_j -> /home/dev/.autojump/functions

Please manually add the following line(s) to ~/.bashrc:

        [[ -s /home/dev/.autojump/etc/profile.d/autojump.sh ]] && source /home/dev/.autojump/etc/profile.d/autojump.sh

Please restart terminal(s) before running autojump.

编辑.zshrc文件
plugins中默认只有git,增加zsh-autosuggestions和autojump

 73 plugins=(
 74   git
 75   zsh-autosuggestions
 76   autojump
 77 )

在.zshrc最后添加autojump插件的设置脚本
下面这一项上上面autojump插件,执行install.py后最后的输出,可以参见上面的输出结果,提示添加到.zshrc最后

109 [[ -s /home/dev/.autojump/etc/profile.d/autojump.sh ]] && source /home/dev/.autojump/etc/profile.d/autojump.sh

如果需要,还可以添加自定义的shell配置

108 source ~/.bash_aliases

完成后退出编辑器。在当前zsh中执行:

source ~/.zshrc

或者重启当前shell终端,上述设置就可以生效了。
一起和zsh愉快的玩耍吧。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

抓饼先生

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值