Date
Oct. 26th, 2024
 
2024年 9月 24日

Post: Power your terminal using Tmux

Power your terminal using Tmux

Published 06:05 May 02, 2023.

Created by @ezra. Categorized in #macOS, and tagged as #UNIX/Linux, #macOS.

Source format: Asciidoc

Table of Content
Note

以下所有按键都区分大小写!

Tmux

安装

$ sudo apt install tmux # Debian/Ubuntu
$ sudo pacman -S tmux # Arch/LyargoOS
$ brew install tmux # macOS

Oh My Tmux

安装

安装到 $HOME 目录下:

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

按键

什么是 <prefix>

  • <prefix>Ctrl + aCtrl + b 键。

  • <prefix> c 指先按下 <prefix> 再按下 c (小写)。

  • <prefix> C-c 指先按下 <prefix> 再按下 Ctrl + c 键。

按键冲突

由于在终端中 Ctrl + a 是十分常用的按键,因此需要编辑 ~/.tmux.conf.local<prefix> 的设定。

# Use C-b as prefixes
set -gu prefix2
unbind C-a
unbind C-b
set -g prefix C-b
bind C-b send-prefix
Warning

注意,使用 Oh My Tmux 请不要编辑 ~/.tmux.conf 文件!

常用按键

  • <prefix> r 重新载入 tmux 配置

  • <prefix> - 纵向分屏

  • <prefix> _ 横向分屏

  • <prefix> C-h<prefix> C-l 导航到上一个/下一个窗口

  • <prefix> H / <prefix J> / <prefix> K / <prefix> L 调整窗口大小

  • <prefix> h / <prefix j> / <prefix> k / <prefix> l 窗口间导航

  • <prefix> > / <prefix> < 交换窗口

  • <prefix> + 最大化/复原当前窗口

  • <prefix> m 开启/关闭鼠标模式

Pinned Message
HOTODOGO
The Founder and CEO of Infeca Technology.
Developer, Designer, Blogger.
Big fan of Apple, Love of colour.
Feel free to contact me.
反曲点科技创始人和首席执行官。
开发、设计与写作皆为所长。
热爱苹果、钟情色彩。
随时恭候 垂询