tmux中默认的shell是zsh,zsh在日常中使用可以协助我们高效地使用shell命令。

配置文件默认位置 ~/.tmux.conf,此外,把常用快捷键也附录在这里,方便记忆。

# 设置Shell
set-option -g default-shell /bin/zsh # 设置复制模式,空格开始选,Enter结束复制
setw -g mode-keys vi #开启status-bar uft-8支持
set -g status-utf8 on # 设定窗口起始
set -g base-index # history
set-option -g history-limit #urxvt tab like window switching (-n: no prior escape seq)
#ruxvt标签式窗口切换
bind -n S-down new-window
bind -n S-left prev
bind -n S-right next
bind -n C-left swap-window -t -
bind -n C-right swap-window -t + # 切换panes
bind-key C-l last-pane # 设置鼠标可以操作|滚动设置
# --> 使用shift键+鼠标键选择文件,Ctrl+Shift+C复制,Ctrl+Shift+V粘贴
# set -g mode-mouse on
# set -g mode-mouse off # --> let cygwin mouse can be used.
# disable mouse control by default - change 'off' to 'on' to enable by default.
setw -g mode-mouse off
set-option -g mouse-resize-pane off
set-option -g mouse-select-pane off
set-option -g mouse-select-window off
# toggle mouse mode to allow mouse copy/paste
# set mouse on with prefix m
bind m \
set -g mode-mouse on \;\
set -g mouse-resize-pane on \;\
set -g mouse-select-pane on \;\
set -g mouse-select-window on \;\
display 'Mouse: ON'
# set mouse off with prefix M
bind M \
set -g mode-mouse off \;\
set -g mouse-resize-pane off \;\
set -g mouse-select-pane off \;\
set -g mouse-select-window off \;\
display 'Mouse: OFF' # 设置窗口可自动调整index
set -g renumber-windows on # 复制和粘贴模式的快捷键
bind y copy-mode
bind c-y copy-mode
bind p paste-buffer
bind c-p paste-buffer # Toggle log to file
bind H pipe-pane -o 'cat >>$HOME/#W-tmux.log' '\;' display-message 'Toggled logging to $HOME/#W-tmux.log' bind h pipe-pane \; display-message 'Ended logging to $HOME/#W-tmux.log' # 设置窗口名字不能修改
set-option -g allow-rename off # 设置启动窗口时默认名字
# bind-key c new-window -n 'zsh' # 设置r键为加载配置文件,并提示信息
bind r source-file ~/.tmux.conf \; display "配置文件已重新加载!" # other
setw -g xterm-keys on #------------------------------------------------------------------------------#
# *** 基本终终端操作 ***
# tmux new -s "session_name" // 创建一个seesion
# tmux new -s "session_name" -d // 创建一个seesion, 并在后台运行
# tmux ls // 列出tmux会话列表
# tmux attach -t session // 进入指定的会话(可终端共享)
# tmux kill-session -t "session" // 删除指定会话
#
# ** 容易混淆 **
# bind-key ; // switch to last pane
# bind-key l // switch to last window
# bind-key L // switch to last session
# bind-key C-l // switch to last pane(like: bind-key ;)
#
# *** 控制台-操作说明 ***
# Ctrl+b // 激活控制台
# ** 系统操作
# ? // 列出所有快捷键;按q返回
# d // 脱离当前会话;
# D // 选择要脱离的会话;在同时开启了多个会话时使用
# Ctrl+z // 挂起当前会话
# r // 强制重绘未脱离的会话
# s // 选择并切换会话;在同时开启了多个会话时使用
# : // 进入命令行模式;
# :new-session // 创建新会话
# [ // 进入复制模式;此时的操作与vi/emacs相同,按q/Esc退出
# ] // 进入粘贴模式;
# ~ // 列出提示信息缓存;其中包含了之前tmux返回的各种提示信息
#
# ** 会话操作
# ( preview session
# ) next session
# L last session
# s list session
# $ rename seesion
#
# ** 窗口操作
# c // 创建新窗口
# & // 关闭当前窗口
# [-] // 切换至指定窗口
# p // 切换至上一窗口
# n // 切换至下一窗口
# l // 在前后两个窗口间互相切换
# w // 通过窗口列表切换窗口
# , // 重命名当前窗口;这样便于识别
# . // 修改当前窗口编号;相当于窗口重新排序
# f // 在所有窗口中查找指定文本
# i // 显示tmux当前信息
#
# ** 面板操作
# ” // 将当前面板平分为上下两块|横向切割 --> 分割成面板
# % // 将当前面板平分为左右两块|竖向切割 --> 分割成面板
# x // 关闭当前面板
# ; // 切换到最后的pane
# ! // 将当前面板置于新窗口;即新建一个窗口,其中仅包含当前面板
# Ctrl+方向键 // 以1个单元格为单位移动边缘以调整当前面板大小
# Alt+方向键 // 以5个单元格为单位移动边缘以调整当前面板大小
# Space // 在预置的面板布局中循环切换;依次包括:
# even-horizontal、
# even-vertical、
# main-horizontal、
# main-vertical、
# tiled
# q // 显示面板编号
# o // 在当前窗口中选择下一面板
# { // 向前置换当前面板
# } // 向后置换当前面板
# 方向键 // 移动光标以选择面板
# Alt+o // 逆时针旋转当前窗口的面板
# Ctrl+o // 顺时针旋转当前窗口的面板 # *** 参考配置 ***
#
# ** 配置1 **
# #设置pan前景色
# set -g pane-border-fg green
# #设置pane背景色
# set -g pane-border-bg black
# #设置终端颜色为256色
# set -g default-terminal "screen-256color"
# #开启status-bar uft-8支持
# set -g status-utf8 on
# #设置pan前景色
# set -g pane-border-fg green
# #设置pane背景色
# set -g pane-border-bg black
# #设置活跃pane前景色
# set -g pane-active-border-fg white
# #设置活跃pane背景色
# set -g pane-active-border-bg yellow
# #设置消息前景色
# set -g message-fg white
# #设置消息背景色
# set -g message-bg black
# #设置消息高亮显示
# set -g message-attr bright
# #设置status-bar颜色
# set -g status-fg white
# set -g status-bg black
# #设置窗口列表颜色
# setw -g window-status-fg cyan
# setw -g window-status-bg default
# setw -g window-status-attr dim
# #设置当前窗口在status bar中的颜色
# setw -g window-status-current-fg white
# setw -g window-status-current-bg red
# setw -g window-status-current-attr bright
# #设置status bar格式
# set -g status-left-length
# set -g status-left "#[fg=green]Session: #S #[fg=yellow]#I #[fg=cyan]#P"
# set -g status-right "#[fg=cyan]%d %b %R"
# set -g status-interval
# set -g status-justify centre
# #开启window事件提示
# setw -g monitor-activity on
# set -g visual-activity on
#
# ** 配置2 **
# # 同一个窗口中的面板操作
# # up
# bind-key k select-pane -U
# #down
# bind-key j select-pane -D
# #left
# bind-key h select-pane -L
# #right
# bind-key l select-pane -R
# #select last window
# bind-key C-l select-window -l
#------------------------------------------------------------------------------#

〖Linux〗tmux 配置文件的更多相关文章

  1. Linux网络配置文件详解

    --Linux网络配置文件详解----------------------2013/10/03 目前在企业级服务器的Linux系统中,RHEL占有绝对的优势,不管是曾经在互联网公司还是在目前测试Vir ...

  2. 分享一个好用的tmux配置文件

    tmux众所周知,不过多介绍,友好的tmux配置,让人用起来很舒服,分享一个tmux配置文件 # ------ general ------------------------------------ ...

  3. Linux 网络配置文件解析

    Linux 网络配置文件解析 网络配置文件路径/etc/sysconfig/network-scripts/ifcfg-*     *代表网卡名 vim /etc/sysconfig/network- ...

  4. Linux网卡配置文件参数注释

    Linux网卡配置文件参数注释 作者:Eric 微信:loveoracle11g [root@linux-node2 ~]# cat /etc/sysconfig/network-scripts/if ...

  5. Linux网卡配置文件路径是什么?要使服务器上外网,必须满足的条件有哪些?需要配置什么?

    Linux网卡配置文件路径是什么?要使服务器上外网,必须满足的条件有哪些?需要配置什么?    答:    网卡配置文件路径:/etc/sysconfig/network-scripts/ifcfg- ...

  6. Linux tmux 工具

    基础术语: sessions :会话,一个用户登录到主机,那么就建立了一个 session,如下图1,详细参考:https://my.oschina.net/u/158589/blog/360862t ...

  7. mysql linux查看配置文件my.cnf位置

    原文:mysql linux查看配置文件my.cnf位置 命令: mysql --help | grep 'Default options' -A 1

  8. Linux yum配置文件详解

    说明:经过网上抄袭和自己的总结加实验,非常详细,可留作参考. yum的配置一般有两种方式:   一种是直接配置/etc目录下的yum.conf文件, 另外一种是在/etc/yum.repos.d目录下 ...

  9. Linux FTP配置文件说明

    一.vsftpd说明: LINUX下实现FTP服务的软件很多,最常见的有vsftpd,Wu-ftpd和Proftp等.Red Hat Enterprise Linux中默认安装的是vsftpd. 访问 ...

随机推荐

  1. 【BLE】CC2541之发现服务与特征值

    一.简介 本文以SimpleBLECentral工程为例,解析CC2541作为主机时是如何发现从机的服务和特征值的. 二.实验平台 协议栈版本:BLE-CC254x-1.4.0 编译软件:IAR 8. ...

  2. Binary Tree ZigZag Level Order Traversal leetcode java

    题目: Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from lef ...

  3. Hadoop家族学习路线图v

    主要介绍Hadoop家族产品,常用的项目包括Hadoop, Hive, Pig, HBase, Sqoop, Mahout, Zookeeper, Avro, Ambari, Chukwa,新增加的项 ...

  4. jQuery UI全教程之一(dialog的使用教程)

    jQuery UI目前的版本已经更新到了1.8.7.个人感觉和easyui相比起来,jQuery UI在界面的美观程度和可定制型更强一些.所以再次将一些jQuery UI组件的用法说明一下,方便日后查 ...

  5. 对Kalman(卡尔曼)滤波器的理解@@zz

    1.简介(Brief Introduction) 在学习卡尔曼滤波器之前,首先看看为什么叫“卡尔曼”.跟其他著名的理论(例如傅立叶变换,泰勒级数等等)一样,卡尔曼也是一个人的名字,而跟他们不同的是,他 ...

  6. MySQL配置版下载安装、配置与使用(win7x64)

    http://jingyan.baidu.com/article/597035521d5de28fc00740e6.html

  7. Android -- Canvas java.lang.UnsupportedOperationException

    干货 java.lang.UnsupportedOperationException at android.view.GLES20Canvas.clipPath(GLES20Canvas.java:2 ...

  8. JS滚轮事件onmousewheel

    典型的应用时鼠标滚轮滚动控制图片或者文字的大小,例如此类的转动鼠标滚轮实现缩放等等交互效果中,会用到 Mousewheel 事件.在大多数浏览器(IE6, IE7, IE8, Opera 10+, S ...

  9. MySql查询时间段的方法(转)

    http://www.jb51.net/article/58668.htm 本文实例讲述了MySql查询时间段的方法.分享给大家供大家参考.具体方法如下: MySql查询时间段的方法未必人人都会,下面 ...

  10. C# winForm webBrowser页面中js调用winForm类方法(转)

      有时我们在winform项目中嵌入了网页,想通过html页面调用后台方法,如何实现呢?其实很简单,主要有三部:   1.在被调用方法类上加上[ComVisible(true)]标签,意思就是当前类 ...