zoukankan      html  css  js  c++  java
  • Tmux使用及配置

    允许鼠标滚动

    新的配置项已简化为

    set -g mouse on
    

    将他写到 ~/.tmux.conf 中然后执行

    tmux source ~/.tmux.conf
    

    注意2.1版本以下的配置项在新版本中已经被废弃

    setw -g mouse-resize-pane on
    setw -g mouse-select-pane on
    setw -g mouse-select-window on
    setw -g mode-mouse on
    

    整理收集

    # Send prefix
    set-option -g prefix C-a
    unbind-key C-a
    bind-key C-a send-prefix
    
    # Use Alt-arrow keys to switch panes
    bind -n M-Left select-pane -L
    bind -n M-Right select-pane -R
    bind -n M-Up select-pane -U
    bind -n M-Down select-pane -D
    
    # Shift arrow to switch windows
    bind -n S-Left previous-window
    bind -n S-Right next-window
    
    # Mouse mode
    set -g mouse on
    
    
    # Set easier window split keys
    bind-key v split-window -h
    bind-key h split-window -v
    
    # Easy config reload
    bind-key r source-file ~/.tmux.conf ; display-message "tmux.conf reloaded"
    

    Send prefix
    把prefix的ctrl+b变为了ctrl+a,因为这样按起来方便些。基本上用tmux的都改了这个。

    Use Alt-arrow keys to switch panes
    不用按prefix,直接用alt+箭头在pane之间switch。实际用过之后才发现真是太方便了!

    Shift arrow to switch windows
    不用按prefix,直接用shift+箭头在window之间switch。太方便了!

    Mouse mode
    开启鼠标模式。用鼠标就能切换window,pane,还能调整pane的大小,方便!

    Set easier window split keys
    这一部分是用来更方便切分pane的。prefix + v 代表竖着切,prefix + h 代表横着切。比起默认的切割方法不仅直观而且方便。

    Easy config reload
    下一次如果修改了.tmux.conf的设置的话,不用关掉tmux。直接用prefix+r,就能重新加载设置。

    别名

    alias tn='tn(){tmux new -s $1};tn'
    alias tk='tk(){tmux kill-session -t $1};tk'
    alias tka='tmux kill-server'
    alias td='tmux detach'
    alias tl='tmux list-session'
    alias tad='tad(){tmux attach -t $1};tad'
    alias tsw='tsw(){tmux switch -t $1};tsw'
    alias tren='tren(){tmux rename-session -t 	$1 $2};tren'
    alias tv='tmux split-window'
    alias th='tmux split-window -h'
    

    建议

    github上有比较好的,建议使用.

    $ cd ~
    $ git clone https://github.com/gpakosz/.tmux.git
    $ ln -s -f .tmux/.tmux.conf
    $ cp .tmux/.tmux.conf.local .
    

    参考:

    Tmux 使用教程

    tmux的使用方法和个性化配置

    Tmux使用手册

    tmux简洁教程及config关键配置

  • 相关阅读:
    ShellExecuteEX打开iqy文件导致excel hang的原因分析
    3种方法遍历商人访问5个城市问题
    用CRT查找内存泄漏
    同步异步和阻塞5-异步非阻塞
    同步异步和阻塞4-同步非阻塞
    同步异步和阻塞3-同步阻塞
    同步异步和阻塞2-测试小项目
    同步异步和阻塞1
    IDA分析脱壳后丢失导入表的PE
    计算机中补码的数学运算逻辑及证明
  • 原文地址:https://www.cnblogs.com/hongdada/p/13237260.html
Copyright © 2011-2022 走看看