Skip to content
kcp edited this page Nov 21, 2020 · 4 revisions

title: Tmux date: 2019-02-28 17:43:53 tags: categories: - 工具

目录 start

  1. Tmux
    1. 配置
      1. 个人配置
      2. 键绑定
      3. 切换
    2. TPM插件管理
      1. tmux-resurrect
      2. maglev
      3. copycat
  2. Tips

目录 end|2020-11-17 14:17|


Tmux

Arch wiki: tmux

tmux 入门 | tmux简洁教程及config关键配置

参考: 文本三巨头:zsh、tmux 和 vim 参考: 程序员高效技巧系列


基本操作

  • 新建会话 tmux new -s myth

  • 连接会话 tmux a -t test

  • 显示所有 tmux ls

  • 重新加载配置文件 tmux source ~/.tmux.conf

  • prefix

    • ? 帮助
    • s 选择 session
    • w 选择 window
    • d deattach 脱离
    • j 下 panel
    • k 上 panel
    • ; 最近的 panel

配置

Oh My Tmux!

个人配置

Tmux配置文件 步骤:

  1. ln -s $(pwd)/tmux.conf ~/.tmux.conf
  2. git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
  3. tmux source ~/.tmux.conf
  4. Ctrl A, I 等待插件安装完成

开启鼠标选择与复制

    set -g mouse on

按住Shift即可照常使用鼠标选中文本


键绑定

Prefix 默认是 C-b 也就是 Ctrl b

切换

  • prefix w 切换 window 或者 Session
  • Prefix () 切换 Session

TPM插件管理

git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm

参考: 保存和恢复 Tmux 会话

  • Prefix I 安装新增的插件

tmux-resurrect

tmux-resurrect
tmux-continuum

prefix c-s 保存会话 prefix c-r 加载历史会话

maglev

Github

copycat

Github

使用: Prefix / 可用 less 一样的方式搜索

Tips

bash: append_path: command not found when open tmux

set-option -g default-command '/bin/bash' 追加到 tmux.conf 即可解决,如果使用 zsh 则是 /usr/bin/zsh

Summary

Clone this wiki locally