Skip to content

Instantly share code, notes, and snippets.

@Hansimov
Last active January 15, 2024 07:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Hansimov/55f92e1f75923fee178d8a5e49e40143 to your computer and use it in GitHub Desktop.
Save Hansimov/55f92e1f75923fee178d8a5e49e40143 to your computer and use it in GitHub Desktop.
.tmux.conf
# TMUX Guide
# https://tmuxguide.readthedocs.io/en/latest/tmux/tmux.html#tmux-conf
# tmux(1) - Linux manual page
# https://man7.org/linux/man-pages/man1/tmux.1.html#FORMATS
# 256 Colors - Cheat Sheet - Xterm, HEX, RGB, HSL
# https://www.ditig.com/256-colors-cheat-sheet
# kill tmux process (if stuck) with following commands
# ps aux | grep tmux
# kill -9 <pid>
# bind keys
unbind C-b
set -g prefix M-z
bind M-z send-prefix
# reload config file
bind r source-file ~/.tmux.conf \; display ".tmux.conf reloaded!"
# enable mouse support
set -g mouse on
# set status style
set -g status-interval 1
set-option -g status-position bottom
set-option -g status-style bg=default
set-option -g status-left ""
set-option -g window-status-format ""
set -g window-status-current-format "#[fg=cyan,bold]#{pane_title} : [#{pane_current_path}]"
# set-option -g status-right "#[fg=cyan,bold] #(TZ='Asia/Beijing' date +'[ww')""#(expr #(TZ='Asia/Beijing' date +'%%U'))""#(TZ='Asia/Beijing' date +'.%%w] %%m-%%d %%H:%%M:%%S')"
# set-option -g status-right "#[fg=cyan,bold] #(date +'[ww')""#(date +'%U')""#(date +'.%w] %m-%d %H:%M:%S')" # In Fish Shell
set-option -g status-right "#[fg=cyan,bold] #(date +'[ww')""#(expr $(date +'%U') + 1)""#(date +'.%w] %m-%d %H:%M:%S')"
# [Tip] To reset set-option, use following cmd:
# set -gu <option>
# set pane border style
set -g pane-border-status top
set -g pane-border-style bg=default,fg=cyan
set -g pane-active-border-style bg=cyan,fg=black
# rename pane title
# tmux select-pane -t <pane-idx> -T <pane-title>
setw -g pane-border-format ' #{pane_index}: #{pane_title} -- [#{pane_current_path}] '
# start selection with 'space' and copy using 'y'
# bind -t vi-copy 'y' copy-selection
# paste using 'p'
# unbind p
# bind p paste-buffer
# bind keys for copy mode
unbind -n a
# bind-key -n M-a copy-mode
unbind-key -T root MouseDrag1Pane
unbind-key -T copy-mode-vi MouseDrag1Pane
unbind-key -T copy-mode MouseDrag1Pane
# bind-key -T copy-mode MouseDrag1Pane copy-selection -x
# bind-key -T copy-mode-vi MouseDrag1Pane copy-selection -x
# [Tip] Shift+LeftMouse select can copy text to clipboard,
# and Shift+Insert can paste from clipboard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment