Skip to content

Instantly share code, notes, and snippets.

@k-shin
Last active June 10, 2019 08:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save k-shin/e23bf4078fa5bc4f8ea3 to your computer and use it in GitHub Desktop.
Save k-shin/e23bf4078fa5bc4f8ea3 to your computer and use it in GitHub Desktop.
## allow utf8
#set-window-option -g utf8 on
## disable ESC delay
set -s escape-time 0
## set scrolback
set-option -g history-limit 50000
set-option -g buffer-limit 20
## set terminal title
set -g set-titles on
set -g set-titles-string "xxxx"
#set -g visual-content on
set -g visual-activity on
set-window-option -g monitor-activity on
# Force to use 256 colors in tmux
#set -g default-terminal 'xterm-256color'
#set -g terminal-overrides 'xterm:colors=256'
# key mappings
## vi binding
set-window-option -g mode-keys vi
## nochanged comand name
setw -g automatic-rename off
## set prefix (^T)
unbind C-b
set -g prefix ^T
bind-key ^T send-prefix
## last window (^t)
unbind ^t
bind ^t last-window
## reload config (r)
bind r source-file ~/.tmux.conf\; display-message "reload .tmux.conf"
## split window
bind - split-window -v\; select-layout even-vertical
bind | split-window -h\; select-layout even-horizontal
## resize panel
bind-key -r H resize-pane -L
bind-key -r J resize-pane -D
bind-key -r K resize-pane -U
bind-key -r L resize-pane -R
# base index at 0
set -g base-index 0
set -g pane-base-index 0
## status line
set -g status-style fg=white,bg=black
## pane border
set -g pane-border-style fg=white
set -g pane-active-border-style fg=black,bg=white
## window-status-current
setw -g window-status-current-style fg=black,bg=white,bold#,underscore
## mouse
#setw -g mouse on
## reload every 1sec
set -g status-interval 1
## left
set -g status-left-length 32
set -g status-left "#[fg=white] xxxx |"
## right
set -g status-right-length 150
set -g status-right "#[fg=white]%Y/%m/%d(%a) %H:%M "
## message
set -g message-style bold,fg=white,bg=red
## .bashrc
set -g default-shell /bin/bash
set -g default-command /bin/bash
# parallel command
bind a set-window-option synchronize-panes on
bind A set-window-option synchronize-panes off
#unbind-key m
bind-key m command-prompt "select-window -t '%%'"
#log output
bind-key e pipe-pane -o 'bash -c "while read -r LINE; do echo \"[\$(date +\"%%Y-%%m-%%dT%%H:%%M:%%S\")] \${LINE}\" >> \${HOME}/.tmux/\$(date +%Y%m%d-%H%M)-#W-#S-#D.log; done "' \; display-message "Logging start."
bind-key E pipe-pane \; display-message "Logging end."
## tmux-plugins
#set -g @tpm_plugins ' \
# tmux-plugins/tpm \
# tmux-plugins/tmux-resurrect \
#'
#set -g @resurrect-save 'S'
#set -g @resurrect-restore 'R'
#run-shell '~/.tmux/plugins/tpm/tpm'
# copy mode
#set-option -g default-command "default > /dev/null 2>&1; reattach-to-user-namespace -l $SHELL"
#bind-key -T copy-mode-vi v send-keys -X begin-selection
#bind-key -T copu-mode-vi y send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
#bind-key -T copu-mode-vi Enter send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
#bind-key p paste-buffer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment