Skip to content

Instantly share code, notes, and snippets.

@mosajjal
Last active June 2, 2020 00:12
Show Gist options
  • Save mosajjal/bf68c7a983b999b003145d8f7d9968e8 to your computer and use it in GitHub Desktop.
Save mosajjal/bf68c7a983b999b003145d8f7d9968e8 to your computer and use it in GitHub Desktop.
my Tmux conf
set -s escape-time 0
setw -g aggressive-resize on
# First remove *all* keybindings
# unbind-key -a
# List keys
bind-key ? list-keys
# Copy mode
bind-key [ copy-mode
# Start Selection
bind-key -T copy-mode v send-keys -X begin-selection
bind-key -T copy-mode Enter send-keys -X copy-selection-and-cancel
# Paste buffer
bind-key ] paste-buffer
# Refresh client
bind-key r refresh-client \; display-message "Refresh already"
set -g default-terminal "xterm-256color"
# Start with index 1
set -g base-index 1
setw -g pane-base-index 1
# Set new prefix
unbind C-b
set -g prefix C-a
bind-key C-a send-prefix
# Clock
setw -g clock-mode-style 24
# Config Reloads
bind R source-file ~/.tmux.conf \; display-message "Config reloaded"
# Mouse on/off
set -g mouse on
set -ga terminal-overrides ',xterm*:smcup@:rmcup@'
# Make mouse-drag work only with Ctrl
unbind -T root MouseDrag1Pane
bind-key -n MouseDrag1Pane if -Ft= '#{mouse_any_flag}' 'if -Ft= \"#{pane_in_mode}\" \"copy-mode -M\" \"send-keys -M\"' 'copy-mode -M'
# Automatically set window title
set-window-option -g automatic-rename on
set-window-option -g xterm-keys on
set-option -g set-titles on
# Detach from tmux
#bind d detach
# Split window
bind-key h split-window -h
bind-key v split-window -v
# Move between panes
#bind-key 'Left' select-pane -L
#bind-key 'Down' select-pane -D
#bind-key 'Up' select-pane -U
#bind-key 'Right' select-pane -R
# Resize pane with Alt (prefix with repeat)
bind-key -r j resize-pane -L 5 \; display-message "Resize left"
bind-key -r k resize-pane -D 5 \; display-message "Resize down"
bind-key -r i resize-pane -U 5 \; display-message "Resize up"
bind-key -r l resize-pane -R 5 \; display-message "Resize right"
# Choose Window
bind-key w choose-window
bind-key -n M-1 if-shell 'tmux select-window -t 1' '' 'new-window -t 1'
bind-key -n M-2 if-shell 'tmux select-window -t 2' '' 'new-window -t 2'
bind-key -n M-3 if-shell 'tmux select-window -t 3' '' 'new-window -t 3'
bind-key -n M-4 if-shell 'tmux select-window -t 4' '' 'new-window -t 4'
bind-key -n M-5 if-shell 'tmux select-window -t 5' '' 'new-window -t 5'
bind-key -n M-6 if-shell 'tmux select-window -t 6' '' 'new-window -t 6'
bind-key -n M-7 if-shell 'tmux select-window -t 7' '' 'new-window -t 7'
bind-key -n M-8 if-shell 'tmux select-window -t 8' '' 'new-window -t 8'
bind-key -n M-9 if-shell 'tmux select-window -t 9' '' 'new-window -t 9'
bind-key -n M-0 if-shell 'tmux select-window -t 10' '' 'new-window -t 10'
run-shell /root/git/tmux-net-speed/net_speed.tmux
set -g @net_speed_interfaces "eth0"
set -g @download_speed_format "%10s"
set -g @upload_speed_format "%10s"
set -g @net_speed_format "D:%10s U:%10s"
set -g status-right-length 60
set -g status-right "#I:#P %d/%m/%Y %H:%M #(netspeed.sh eth0)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment