ubuntu16.04编程软件之工具类

zsh

安装zsh

+ zsh 兼容bash
+ zsh 官网:Zsh
+ 查看CentOS已安装的shell

cat /etc/shells

正常结果应该是这样的:

/bin/sh
/bin/bash
/sbin/nologin
/bin/dash
/bin/tcsh
/bin/csh

+ 查看当前的shell

echo $SHELL
  • 更新软件源
sudo apt-get install update
  • 安装zsh
sudo apt-get install zsh

安装oh-my-zsh

保证已经安装好git和wget

wget --no-check-certificate https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh

完成后将shell设置为zsh模式

sudo chsh -s /bin/zsh

重启或注销下就OK了

配置zsh

zsh文件的位置为: ~/.zshrc,每一项配置在文件中有详细的解释。

  • 修改主题:
ZSH_THEME=”ys”
  • 添加插件
plugins=(git autojump)

目前用到的自定义配置不多,更改配置后需要重启终端。

插件推荐

  • 强力跳转:autojump
sudo apt-get install autojump

然后编辑~/.zshrc,plugins=(git autojump)

  • 强力自动补全
1.下载 http://mimosa-pudica.net/zsh-incremental.html 的incr-0.2.zsh 
2.把incr-0.2.zsh放到新建的~/.oh-my-zsh/plugins/incr目录下 
3.chmod 777 incr-0.2.zsh给予其777权限 
4.编辑~/.zshrc,插入source ~/.oh-my-zsh/plugins/incr/incr-0.2.zsh
  • wd
简单地讲就是给指定目录映射一个全局的名字,以后方便直接跳转到这个目录,比如:
编辑配置文件,添加上 wd 的名字:vim /root/.zshrc
我常去目录:/opt/setups,每次进入该目录下都需要这样:cd /opt/setups
现在用 wd 给他映射一个快捷方式:cd /opt/setups ; wd add setups
以后我在任何目录下只要运行:wd setups 就自动跑到 /opt/setups 目录下了
插件官网:https://github.com/mfaerevaag/wd

+ zsh-syntax-highlighting

这个插件会对终端命令高亮显示,比如正确的拼写会是绿色标识,否则是红色,另外对于一些shell输出语句也会有高亮显示,算是不错的辅助插件
插件官网:https://github.com/zsh-users/zsh-syntax-highlighting
安装,复制该命令:'git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting'
编辑:vim ~/.zshrc,找到这一行,后括号里面的后面添加:plugins=( 前面的一些插件名称 zsh-syntax-highlighting)
刷新下配置:source ~/.zshrc

主题 

  • oh-my-zsh 的主题列表介绍(还是太长了):https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
  • 我们看下安装 oh-my-zsh 的时候,自带有多少个:ls -l /root/.oh-my-zsh/themes |grep "^-"|wc -l,我这边得到的结果是:140
    推荐(排名有先后):
ys
agnoster
avit
blinks

其他

  • 呃,这个其实可以不用讲的,你自己用的时候你自己会发现的,各种便捷,特别是用 Tab 多的人一定会有各种惊喜的。
  • 使用 ctrl-r 来搜索命令历史记录。按完此快捷键后,可以输入关键命令词语,如果历史记录有含有此词语会显示出来。
  • 命令别名:
    在命令行中输入 alias 可以查看已经有的命令别名
    自己新增一些别名,编辑文件:vim ~/.zshrc,在文件加入下面格式的命令,比如以下是网友提供的一些思路:
alias cls='clear'
alias ll='ls -l'
alias la='ls -a'
alias grep="grep --color=auto"
alias -s html='vim'   # 在命令行直接输入后缀为 html 的文件名,会在 Vim 中打开
alias -s rb='vim'     # 在命令行直接输入 ruby 文件,会在 Vim 中打开
alias -s py='vim'      # 在命令行直接输入 python 文件,会用 vim 中打开,以下类似
alias -s js='vim'
alias -s c='vim'
alias -s java='vim'
alias -s txt='vim'
alias -s gz='tar -xzvf' # 在命令行直接输入后缀为 gz 的文件名,会自动解压打开
alias -s tgz='tar -xzvf'
alias -s zip='unzip'
alias -s bz2='tar -xjvf'
  • 我们现在增加系统变量在:/etc/profile 后,输入命令:source /etc/profile 之后,重启服务器发现刚刚的系统变量现在没效果。解决办法:vim ~/.zshrc,在该配置文件里面增加一行:source /etc/profile,然后刷新 zsh 的配置:source ~/.zshrc。

参考


teminator

terminator 安装

sudo apt-get install terminator

常用快捷键

Ctrl+Alt+T 新建窗口
Ctrl+Shift+T 新建标签页
Ctrl+Shift+O (水平分割窗口)
Ctrl+Shift+E(垂直分割窗口)
Alt+Up (切换窗口)
Alt+Down
Alt+Left
Alt+Right

配置

为了让terminator更加美观

扫描二维码关注公众号,回复: 4203184 查看本文章
  • 修改terminator的config文件
    ~/.config/terminator/config
    将以下内容替换掉原来的内容
[global_config]
  focus = system
  suppress_multiple_term_dialog = True
  tab_position = bottom
  title_transmit_bg_color = "#d30102"
  window_state = maximise
[keybindings]
[layouts]
  [[default]]
    [[[child1]]]
      parent = window0
      type = Terminal
    [[[window0]]]
      parent = ""
      type = Window
[plugins]
[profiles]
  [[default]]
    background_color = "#002b36"
    background_darkness = 0.92
    background_image = None
    background_type = transparent
    cursor_color = "#eee8d5"
    font = Monospace 11
    foreground_color = "#e6e0da"
    icon_bell = False
    palette = "#073642:#dc322f:#859900:#b58900:#268bd2:#d33682:#2aa198:#eee8d5:#586e75:#cb4b16:#586e75:#657b83:#839496:#6c71c4:#93a1a1:#fdf6e3"
    split_to_group = True

参考

Solarized-Dark theme configuration in Terminator – Diwakar Moturu – Medium


猜你喜欢

转载自www.cnblogs.com/ChrisCoder/p/10010123.html
今日推荐