这篇博客跟以前的vim配置一样,都是为了以后本人自己方便备份的tmux配置文件

0.安装

  centos默认自带的软件是screen,没有带tmux,所以需要源代码安装

get clone http://github.com/tmux/tmux.git
cd tmux/
sh autogen.sh
./configure

  这个时候会出错,因为tmux需要libevent环境。而且高版本的tmux需要libevent版本是2.0以上的,而centos6.x通过yum 安装的libevent是1.x版本的,需要卸载后源码安装libevent。

  https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz

  编译完libevent后

cd tmux
./configure
make

  这个时候可能会出现错误,通过下面修改

if [ `getconf WORD_BIT` = '' ] && [ `getconf LONG_BIT` = '' ] ; then
ln -s /usr/local/lib/libevent-2.0.so. /usr/lib64/libevent-2.0.so.
else
ln -s /usr/local/lib/libevent-2.0.so. /usr/lib/libevent-2.0.so.
fi

然后就基本可以了

1.配置

 #2015年6月8日 创建配置文件
#文档: http://aquaregia.gitbooks.io/tmux-productive-mouse-free-development_zh/content/
#vim /etc/tmux.conf
#vim ~/.tmux.conf
#PREFIX : source-file ~/.tmux.conf 使配置生效 #set --> set-option
#setw --> set-window-option #定义方便的前缀
set -g prefix C-a # -g 选项是全局配置
unbind C-b #取消绑定 #修改默认延时
set -sg escape-time #设置窗口和面板的索引
set -g base-index #窗口的初始序号;默认为0,这里设置为1
setw -g pane-base-index #定制新键 虽然这里没有指定PREFIX键,但是实际用的时候还是要的
bind r source-file ~/.tmux.conf \; display "Reloaded!"
#下面这种方式是可以设置我们使用Ctrl-x来进行,但是这么做,会导致任何程序命令都禁用该组合键,所以要小心
#bind-key -n C-x source-file ~/.tmux.conf \; display "ok!"
#bind C-x send-prefix #无效 #因为绑定了C-a作为Prefix键,会导致C-a禁用,通过下面方法发送前缀键到其他程序
bind C-a send-prefix #分割面板
unbind %
bind | split-window -h
unbind '"'
bind - split-window -v #类vim 使用hjkl来移动面板
unbind h
unbind j
unbind k
unbind l
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
#定义窗口间循环切换 默认是prefix p/n
bind -r C-h select-window -t :-
bind -r C-l select-window -t :+
#调整面板大小
#-r 选项表示该命令可重复使用 如 Prefix H H就是移动10个单位
bind -r H resize-pane -L
bind -r J resize-pane -D
bind -r K resize-pane -U
bind -r L resize-pane -R
#处理鼠标
#setw -g mode-mouse on
#set -g mouse-select-pane on
#set -g mouse-resize-pane on
#set -g mouse-select-window on #支持256色
set -g default-terminal "screen-256color"
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
setw -g window-status-current-fg white
setw -g window-status-current-bg red
setw -g window-status-current-attr bright
set -g pane-border-fg green
set -g pane-border-bg black
set -g pane-active-border-fg white
set -g pane-active-border-bg yellow
set -g message-fg white
set -g message-bg black
set -g message-attr bright #配置状态栏
set -g status-left-length
set -g status-left "#[fg=green]Session: #S #[fg=yellow]Window: #I #[fg=cyan]Panel: #P "
set -g status-right "#[fg=cyan]#(date +%H:%M' ')" #状态栏右方的内容;这里的设置将得到类似23:59的显示
set -g status-utf8 on
set -g status-interval #每30秒更新一次状态栏
set -g status-justify centre #状态栏信息居中 #识别其他窗口的活动
setw -g monitor-activity on
set -g visual-activity on #使用复制模式滚动输出
setw -g mode-keys vi #最大化面板
unbind Up
bind Up new-window -d -n tmp \; swap-pane -s tmp. \; select-window -t tmp
unbind Down
bind Down last-window \; swap-pane -s tmp. \; kill-window -t tmp

  用vim+tmux+(任意一种脚本)这三个东西在一起,编程是多么惬意的一件事。基本可以实现0鼠标操作了。 浏览网页时firefox+vimperator ,chrome+vimium (我现在就是用chrome,类似的有很多,chrome的vim插件功能有限,有时候要使用chrome本身的快捷键,慢慢地就熟悉了。) .

  https://blog.linuxeye.com/323.html

  

tmux使用及配置的更多相关文章

  1. linux中neovim+tmux安装与配置遇到的问题

    Neovim 安装与配置 安装 pip3 install neovim 之前安装过anaconda,默认安装python3和pip3 检查状态 :checkhealth 终端输入'nvim' 进入nv ...

  2. 【tmux环境配置】在centos6.4上配置tmux

    我学习tmux的动力如下: (1)tmux大法好.原因是被同学安利过tmux. (2)多个terminal下ssh到开发机太麻烦.还是之前实习的时候,总要开N个terminal去ssh开发机,这种东西 ...

  3. 终端环境之tmux

    今天继续介绍我的终端环境,tmux. why tmux? 用一个工具的第一问自然还是为什么要用.其实当时使用tmux的原因很简单.工作中经常需要长时间的编译.总想要下班后要关机的情况下,(肯定有人问我 ...

  4. [转载] Tmux 速成教程:技巧和调整

    原文: http://blog.jobbole.com/87584/ 决定从 screen 转向 tmux 了, 非常喜欢 tmux 的窗格功能. 简介 有些开发者经常要使用终端控制台工作,导致最终打 ...

  5. Linux下终端利器tmux(转)

    “君子生非异也,善假于物也” .–语出<荀子·劝学> 如果记得没错的话,<荀子·劝学>我们这一代高中的时候应该都读过这篇文章.原意大概是君子的资质与一般人没有什么区别,君子之所 ...

  6. CentOS6配置Taiga

    背景 企业项目管理是一个比较复杂的事情,这个市场需求非常大,目前市面上也存在着teambition,tower等平台,但是这些工具平台目前都是付费才能有完整的功能,免费版根本不能满足团队的需求.一番调 ...

  7. tmux不自动加载配置文件.tmux.conf

    /********************************************************************** * tmux不自动加载配置文件.tmux.conf * ...

  8. 启动shell时自动启动tmux

    Bash 对bash用户, 只需要将下面命令添加到自己家目录下的.bashrc, 要注意这句命令需要在alias配置之前.对其它shell的配置也是类似的 ~/.bashrc # If not run ...

  9. Linux tmux

    一.简介 Tmux是一个用于终端复用的软件,它允许一个用户在一个终端窗口或远程终端会话中使用多个不同的终端会话.在同一个命令行接口处理多个程序,以及将程序从已经开始运行另外的程序的Unix shell ...

随机推荐

  1. ubuntu普通账户获取root权限的方法以及su和su -的区别

    打开命令窗口 输入命令:sudo passwd root 然后按照上图中的操作进行即可. su和su -的命令的不同: su命令和su -命令最大的本质区别就是:前者只是切换了root身份,但Shel ...

  2. 基于springboot跟poi封装的最便捷的excel导出

    发布时间:2018-11-15   技术:springboot1.5.6 + maven3.0.5 + jdk1.8   概述 Springboot最便捷的Excel导出,只需要一个配置文件即可搞定 ...

  3. [javase学习笔记]-8.3 statickeyword使用的注意细节

    这一节我们看静态在使用过程中应注意的几个细节. 上一节我们在学习成员变量与静态变量的差别时,对于两种变量的调用方式不同一时候出现了"无法从静态上下文中訪问非静态变量"的错误.这个问 ...

  4. ios中布局(推荐一)

    - (void)viewDidLoad { [super viewDidLoad]; NSArray *data=@[@"标题一",@"标题二",@" ...

  5. samba config

    [global] netbios name = HARDY     #设置服务器的netbios名字 server string = my server #对samba服务器的描述 workgroup ...

  6. Emacs显示光标在哪个函数

    Emacs24中打开which-function-mode即可. 在.emacs中添加一行: (which-function-mode 1) 调整which-function在mode-line中的显 ...

  7. 将 numeric 转换为数据类型 numeric 时出现算术溢出错误

    保存数据时控制台报错: Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: 将 numeric 转换为数据类型 numeric 时出 ...

  8. ios实例开发精品文章推荐(8.13)

    提示用户对产品进行评价 http://www.apkbus.com/android-137752-1-1.html设置UILabel和UITextField的Insets http://www.apk ...

  9. JAVA操作mysql(如何更加面向对象的操作数据库)

    既然谈到面向对象,所以,先把连接信息给搞个对象出来: public class DBInfo { private String driver; private String host; private ...

  10. 关于去哪儿网的UI自动化测试脚本

    UI自动化测试Qunar机票搜索场景访问Qunar机票首页http://flight.qunar.com,选择“单程”,输入出发.到达城市,选择today+7日后的日期,点“搜索”,跳转到机票单程搜索 ...