Skip to content

Latest commit

 

History

History
60 lines (49 loc) · 2.41 KB

tmux_config.md

File metadata and controls

60 lines (49 loc) · 2.41 KB

Tmux

先上配置好的效果图:
tmux1
tmux2
tmux3

Tmux安装

brew install tmux

Tmux配置

安装.tmux配置文件,官方github地址: https://github.com/gpakosz/.tmux#installation

  • .tmux安装要求:

    • tmux >= 2.1
    • outside of tmux, $TERM must be set to xterm-256color
  • .tmux安装 按照下面命令安装: (安装之前首先备份一下 ~/.tmux.conf 文件)

    cd
    git clone https://github.com/gpakosz/.tmux.git
    ln -s -f .tmux/.tmux.conf
    cp .tmux/.tmux.conf.local .
  • 然后配置~/.tmux.conf.local文件,将下列代码取消屏蔽,并将原始的屏蔽:

    tmux_conf_theme_left_separator_main=''
    tmux_conf_theme_left_separator_sub=''
    tmux_conf_theme_right_separator_main=''
    tmux_conf_theme_right_separator_sub=''
    

    可以修改右侧状态栏来显示天气预报:

    tmux_conf_theme_status_right='#{prefix}#{pairing}#{synchronized} #(curl wttr.in?format=3) , %R , %d %b | #{username}#{root} | #{hostname} '
    

    效果如下:
    tmux4

    更详细配置介绍请看

  • 官方推荐安装Source Code Pro字体,官方GitHub地址或者Powerline中提供的Source Code Pro字体,解压后文件夹source-code-pro/TTF/下直接安装即可。但是安装了Source Code Pro字体后安装colorls显示会有问题,所以为了兼容性推荐 powerline nerd-font字体。具体可以查看 Nerd Font README 来获得更多安装详细介绍。
    Note for iTerm2 users - Please enable the Nerd Font at iTerm2 > Preferences > Profiles > Text > Non-ASCII font > mononoki Nerd Font.
    iTerm2

  • 安装Powerline symbols.

  • 使~/.tmux.conf.local配置文件生效:

    tmux # 启动tmux
    
    #然后`Ctrl+b`再按`:`进入`tmux`命令行模式
    source ~/.tmux.conf