ubuntu使用zsh进行命令行自动补全

ubuntu使用zsh进行命令行自动补全

1、zsh下载及配置

安装zsh

sudo apt-get install cmake git zsh

安装ohmyzsh

wget -p ~/ https://github.com/ohmyzsh/ohmyzsh/blob/master/tools/install.sh
sudo chmod +x ~/install.sh
sh ~/install.sh

若找不到install.sh,则直接到ohmyzsh仓库中下载install.sh文件,然后到下载目录下加读写权限,然后安装

sudo chmod +x ~/install.sh
sh ~/install.sh

安装必要的插件

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions

出现网络问题时

git clone http://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone http://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions

修改zshrc

gedit ~/.zshrc

在文件中添加

plugins=(git
zsh-autosuggestions
zsh-syntax-highlighting
)
alias ezs="gedit ~/.zshrc"
alias szs="source ~/.zshrc"
alias sss="source devel/setup.zsh"

# source /opt/ros/melodic/setup.zsh # 注意ros版本
# export PATH=~/anaconda3/bin:$PATH

setopt no_nomatch # 允许使用 *缺省

使能代码提示

先别急着关闭.zshrc文件,ctrl+f找到plugins=(git)这一行,如果没有添加。更改为如下

plugins=(git zsh-autosuggestions)

2、安装terminator终端

sudo apt-get install terminator

安装后创建目录,以修改不同的终端风格

mkdir ~/.config/terminator
gedit ~/.config/terminator/config

我的终端风格

[global_config]
  suppress_multiple_term_dialog = True
  title_font = Ubuntu Mono 11[keybindings]
[keybindings]
[layouts]
  [[default]]
    [[[child1]]]
      parent = window0
      type = Terminal
    [[[window0]]]
      parent = ""
      size = 800, 500
      type = Window
[plugins]
[profiles]
  [[default]]
    background_color = "#484343"
    background_darkness = 0.8
    background_type = transparent
    font = Ubuntu Mono 15
    foreground_color = "#e0f0f1"
    show_titlebar = False
    use_system_font = False

效果
请添加图片描述
方案二

[global_config]
  suppress_multiple_term_dialog = True
  title_font = Ubuntu Mono 11[keybindings]
  title_inactive_fg_color = "#8ae234"
  title_transmit_fg_color = "#ce5c00"
[keybindings]
[layouts]
  [[default]]
    [[[child1]]]
      parent = window0
      type = Terminal
    [[[window0]]]
      parent = ""
      size = 800, 500
      type = Window
[plugins]
[profiles]
  [[default]]
    background_color = "#000000"
    background_type = transparent
    cursor_color = "#e0f0f1"
    font = Ubuntu Mono 15
    foreground_color = "#e0f0f1"
    show_titlebar = False
    use_system_font = False

保存后重启terminator即可

3、进入zsh终端

输入如下即可进入zsh终端

zsh

退出zsh

exit

每次打开进入zsh

chsh -s /bin/zsh 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值