tmux macOS 安装和简单配置使用

    xiaoxiao2023-10-15  21

    tmux macOS install

    1,tmux安装2,tmux快捷键2.1,会话session2.2,窗口window2.3,窗格pane

    1,tmux安装

    $ brew search tmux $ brew install tmux $ tmux -V │ tmux 2.9a

    2,tmux快捷键

    创建tmux配置文件,默认的前缀快捷键 ⌃b (Ctrl + b ) 修改为 ⌃a ( Ctrl + a) $ cd ~ $ touch .tmux.conf $ cat .tmux.conf # Change the prefix key to C-a set -g prefix C-a unbind C-b bind C-a send-prefix tmux配置文件重载 tmux source-file ~/.tmux.conf 绑定快捷键为r $ cat .tmux.conf # 绑定快捷键为r bind r source-file ~/.tmux.conf \; display-message "Config reloaded.." 修改为h横向分割,v纵向分割 $ cat .tmux.conf # Set easier window split keys bind-key v split-window -h bind-key h split-window -v $ cat .tmux.conf # 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

    2.1,会话session

    新建会话并命名为s1 $ tmux new -s s1 列出所有会话 $ tmux ls 进入会话s1 tmux a -t s1 断开当前会话,会话在后台运行 tmux detach Ctrl+a s 查看回话列表Ctrl+a d 后台运行

    2.2,窗口window

    Ctrl+a c 新建窗口Ctrl+a n 下一个窗口Ctrl+a p 上一个窗口Ctrl+a w 列出所有窗口Ctrl+a , 重命名窗口

    2.3,窗格pane

    Ctrl+a x 关闭窗格(需要输入y)Ctrl+a h 横向分割窗格Ctrl+a v 纵向分隔窗格Ctrl+a z 最大化当前窗格,再按一次恢复(不启用鼠标模式,方便鼠标选择文本进行复制操作)Ctrl+a PgUp PgDn 翻页 q 退出

    参考;

    Tmux使用手册tmux简洁教程及config关键配置Tmux 快捷键 & 速查表
    最新回复(0)