zoukankan      html  css  js  c++  java
  • 源码编译tmux

    (1)clone 源代码仓库:

    $ git clone https://github.com/tmux/tmux.git
    

    (2) 编译之前先安装libevent,去官网下载tar包:
    http://libevent.org

    选择需要下载的版本复制链接地址,使用wget下载到本地(图形化的也可以直接下载),如(选择合适的版本,一般选stable即可):

        wget https://github.com/libevent/libevent/releases/download/release-2.0.22-stable/libevent-2.0.22-stable.tar.gz
    
        tar -xzf  libevent-2.0.22-stable.tar.gz
        cd  libevent-2.0.22-stable/
        $ ./configure && make
        $ sudo make install
    

    (3) 编译tmux:

        cd tmux/
        sh autogen.sh
       ./configure && make
    

    安装编译过程可能会提示一些错误:

    1)aclocal command not found
    原因:自动编译工具未安装,安装上即可:

    centOS: yum install automake
    
    1. configure: error: "curses or ncurses not found"
    ubuntu:apt-get install libncurses5-dev
    centos: yum install ncurses-devel
    

    (4) 编译成功之后会在tmux下生成一个可执行程序:tmux

        ./tmux
    

    执行的时候可能会出现找不到库的情况:

    ./tmux: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory
    

    把安装好的libevent库的路径使用软链接到对应的目录:

        64位:
            ln -s /usr/local/lib/libevent-2.0.so.5 /usr/lib64/libevent-2.0.so.5
        32位:
            ln -s /usr/local/lib/libevent-2.0.so.5 /usr/lib/libevent-2.0.so.5
    

    (5)设置环境变量

      export PATH=xxx

    (6)常用的tmux配置:

    [root@c936a812-4ccb-491f-8eee-1dd4f670494b ~]# cat .tmux.conf
    set -g prefix C-x
    unbind C-b
    setw -g mode-keys vi
    #允许用鼠标切换窗口/调节分屏大小
    setw -g mouse-resize-pane on
    setw -g mouse-select-pane on
    setw -g mouse-select-window on
    setw -g mode-mouse on
    
    set-option -g history-limit 5000
    
    bind -t vi-copy 'v' begin-selection     # Begin selection in copy mode.
    bind -t vi-copy 'C-v' rectangle-toggle  # Begin selection in copy mode.
    bind -t vi-copy 'y' copy-selection      # Yank selection in copy mode.
    
    bind Left swap-window -t -1
    bind Right swap-window -t +1
    
    bind '"' split-window -c "#{pane_current_path}"
    bind % split-window -h -c "#{pane_current_path}"
    bind c new-window -c "#{pane_current_path}"
    
    bind k selectp -U
    bind j selectp -D
    bind h selectp -L
    bind l selectp -R
    
    bind ^k resizep -U 10
    bind ^j resizep -D 10
    bind ^h resizep -L 10
    bind ^l resizep -R 10
    
    bind ^u swapp -U
    bind ^d swapp -D
    
    bind ^a last
    bind ^q killp
    
    set-window-option -g window-status-current-bg yellow
    set-window-option -g window-status-current-fg black
    
    # Plugins
    set -g @plugin 'tmux-plugins/tpm'
    set -g @plugin 'tmux-plugins/tmux-yank'
    set -g @plugin 'tmux-plugins/tmux-copycat'
    set -g @plugin 'tmux-plugins/tmux-resurrect'
    set -g @plugin 'tmux-plugins/tmux-continuum'
    
    # Plugin configure
    set -g @continuum-restore 'on'
    
    run '~/.tmux/plugins/tpm/tpm'
    You have new mail in /var/spool/mail/root
    

    其中需要用到插件管理,需要先安装插件管理器:

    $ git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
  • 相关阅读:
    Azure PowerShell (7) 使用CSV文件批量设置Virtual Machine Endpoint
    Windows Azure Cloud Service (39) 如何将现有Web应用迁移到Azure PaaS平台
    Azure China (7) 使用WebMetrix将Web Site发布至Azure China
    Microsoft Azure News(4) Azure新D系列虚拟机上线
    Windows Azure Cloud Service (38) 微软IaaS与PaaS比较
    Windows Azure Cloud Service (37) 浅谈Cloud Service
    Azure PowerShell (6) 设置单个Virtual Machine Endpoint
    Azure PowerShell (5) 使用Azure PowerShell创建简单的Azure虚拟机和Linux虚拟机
    功能代码(1)---通过Jquery来处理复选框
    案例1.用Ajax实现用户名的校验
  • 原文地址:https://www.cnblogs.com/kuang17/p/9836839.html
Copyright © 2011-2022 走看看