前のページに戻る(ファイル形式: Eric's Markdown)

Tmux

インストール

https://github.com/tmux/tmux

Dependencies

Local Install

20201116


wget https://github.com/tmux/tmux/releases/download/3.1c/tmux-3.1c.tar.gz
wget https://github.com/libevent/libevent/releases/download/release-2.1.12-stable/libevent-2.1.12-stable.tar.gz
wget https://invisible-mirror.net/archives/ncurses/ncurses-6.2.tar.gz

tar zxf *

cd libevent-2.1.11-stable

./configure --prefix=${HOME}/.local && make && make install

cd ..

cd ncurses-6.2

./configure \
  --prefix=${local}/.local \
  --with-pkg-config-libdir=${HOME}/.local/pkgconfig \
  --enable-pc-files \
  --wht-termlib && make && make install

cd ..

# まだしていない場合
file="${HOME}/.local/INSTALL/gccOpts.source"
mkdir -p ${HOME}/.local/INSTALL
echo 'export PKG_CONFIG_PATH="${HOME}/.local/lib/pkgconfig"' >> $file
echo 'export LDFLAGS="-L${HOME}/.local/lib $LDFLAGS"' >> $file
echo 'export  CFLAGS="-I${HOME}/.local/include $CFLAGS"' >> $file
echo 'export TMUX_TMPDIR="$HOME/.cache/tmux-tmp/"'

source $file

#####

cd tmux-3.1c

./configure --prefix=${HOME}/.local && make && make install

cd ..

# まだしていない場合
export LD_LIBRARY_PATH="${HOME}/.local/lib:${LD_LIBRARY_PATH}"

構成要素

それぞれ1つ以上のモノをもつ。

~/.tmux.conf



# Basic Knowledgement
#
## `set` aliased from set-option`
### `-g`    ... Global(Define to Session)
### `-s`    ... Server(Define to ServerProcess, No-Rewrite by Window/Session)
### `-w`    ... Window(Applied a Window)
### `-w -g` ... Window Global(Applied all Windows)
## `set-window-option` aliased `setw`

######################################################
# Global Configuration
## About Session
### PRERIX KEY
set -g prefix C-q
bindkey C-q send-prefix
unbind-key C-b # unbind default prefix
### Start Window Index Number
set -g base-index 1
### Allow Control by Mouse
set -g mouse on
### Show Status bar
set -g status on
## About Window
### Based-keybind
set -g mode-keys vi
### Start Pein Index Number
setw -g pane-base-index 1


# デフォルトシェルの設定
set-option -g default-shell /bin/zsh
# 256色対応
set-option -g default-terminal screen-256color
set -g terminal-overrides 'xterm:colors=256'

# デフォルトのPREFIXキーを別のキーに変更し、デフォルトを解除.
set -g prefix C-g
unbind C-g

#############################
# ステータスバーに関する設定
#
# $(shellCmd) ... 標準出力最上行
# #[Attributes] ... 色や属性(e.g. fg=colour255 , #[bold], #[dim])
# Attribute> bold, dim, underscore, blink, reverse, hidden, italics, default
#------------------------------------
# #S ... SessionName, ## ... Escaped '#'
# #H ... HOSTNAME ,   #h ... HOSTNAME(without LOCALHOST)
# CurrentWindow: #F ... Flag,     #I ... Index  #W ... Name
# CurrentPein:   #D ... Identify, #P ... Index, #T ... Title
#
# Included: strftime, #[INT][OPTION] ... INT=Max_Character
#
# %Y/%m/%d(%a) %H:%M ""

#
#
#
## General
set-option -g status-position top     # トップ表示
set-option -g status-justify "centre" # センタリング
set-option -g status-bg "colour238"   # 背景色
set-option -g status-fg "colour255"   # 文字色
#
## Left
#
set-option -g status-left '#{prefix_highlight} #H:$M - %m/$d(%a)'
set-option -g status-left-length  90  # 左長
## Right

set-option -g status-right '#{cpu_icon} #{cpu_percentage}(#{cpu_temp}) #{ram_icon} #{ram_percentage} #{online_status} #{net_speed}'
set-option -g status-right-length 90  # 右長

######################
# Window
set -g window-status-current-fg red # アクティブなウィンドウを目立たせる
set -g window-status-current-bg
set -g window-status-current-attr bold
set -g

########################################
# Plugin
# TPM - https://github.com/tmux-plugins/tpm
# At First, Cloning!, and INSTALL(PREFIX+I), Update(PREFIX+U)
#> git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
set -g @plugin 'tmux-plugins/tpm'
####
set -g @plugin 'tmux-plugins/tmux-cpu'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-pain-control
set -g @plugin 'tmux-plugins/tmux-online-status'
set -g @plugin 'tmux-plugins/tmux-sidebar'
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'

#####
set -g @plugin 'tmux-plugins/tmux-net-speed'
set -g @download_speed_format "%10s"
set -g @upload_speed_format "%10s"
set -g @net_speed_format "D:%10s U:%10s"



####
run '~/.tmux/plugins/tpm/tpm'