Skip to content

Instantly share code, notes, and snippets.

@AkashDhiman
Created October 31, 2023 20:04
Show Gist options
  • Save AkashDhiman/3f3d3e0cb1386a2e0f65a8a0fded9efb to your computer and use it in GitHub Desktop.
Save AkashDhiman/3f3d3e0cb1386a2e0f65a8a0fded9efb to your computer and use it in GitHub Desktop.
My tmux configuration
# start session number from 1 rather than 0
set -g base-index 1
# start pane number from 1 similar to windows
set -g pane-base-index 1
# make the current window the first window
bind T swap-window -t 1
# dont mess up with other ctrl-a options by pressing ctrl-a twice
bind C-a send-prefix
# horizontal split
bind s split-window -h
# vertical split
bind v split-window -v
# pane movement similar to vim
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# resize panes
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
# to cycle through windows
bind -r C-h select-window -t :-
bind -r C-l select-window -t :+
bind b previous-window
# enable mouse
set -g mouse on
# monitor activities in other windows
setw -g monitor-activity on
set -g visual-activity on
# copy to system clipboard
bind C-c run "tmux save-buffer - | xclip -i -sel clipboard"
# paste from system clipboard
bind C-v run "tmux set-buffer \"$(xclip -o -sel clipboard)\"; tmux paste-buffer"
# don't allow tmux to rename the window based on commands running
set-window-option -g allow-rename off
# manual theme
# set -g default-terminal "screen-256color"
# set -g status-bg black
# set -g status-fg white
## COLORSCHEME: gruvbox dark (medium)
set-option -g status "on"
# default statusbar color
set-option -g status-style bg=colour237,fg=colour223 # bg=bg1, fg=fg1
# default window title colors
set-window-option -g window-status-style bg=colour214,fg=colour237 # bg=yellow, fg=bg1
# default window with an activity alert
set-window-option -g window-status-activity-style bg=colour237,fg=colour248 # bg=bg1, fg=fg3
# active window title colors
set-window-option -g window-status-current-style bg=red,fg=colour237 # fg=bg1
# pane border
set-option -g pane-active-border-style fg=colour250 #fg2
set-option -g pane-border-style fg=colour237 #bg1
# message infos
set-option -g message-style bg=colour239,fg=colour223 # bg=bg2, fg=fg1
# writing commands inactive
set-option -g message-command-style bg=colour239,fg=colour223 # bg=fg3, fg=bg1
# pane number display
set-option -g display-panes-active-colour colour250 #fg2
set-option -g display-panes-colour colour237 #bg1
# clock
set-window-option -g clock-mode-colour colour109 #blue
# bell
set-window-option -g window-status-bell-style bg=colour167,fg=colour235 # bg=red, fg=bg
## Theme settings mixed with colors (unfortunately, but there is no cleaner way)
set-option -g status-justify "left"
set-option -g status-left-style none
set-option -g status-left-length "80"
set-option -g status-right-style none
set-option -g status-right-length "80"
set-window-option -g window-status-separator ""
set-option -g status-left "#[bg=colour241,fg=colour248] #S #[bg=colour237,fg=colour241,nobold,noitalics,nounderscore]"
set-option -g status-right "#[bg=colour237,fg=colour239 nobold, nounderscore, noitalics]#[bg=colour239,fg=colour246] %Y-%m-%d  %H:%M #[bg=colour239,fg=colour248,nobold,noitalics,nounderscore]#[bg=colour248,fg=colour237] #h "
set-window-option -g window-status-current-format "#[bg=colour214,fg=colour237,nobold,noitalics,nounderscore]#[bg=colour214,fg=colour239] #I #[bg=colour214,fg=colour239,bold] #W#{?window_zoomed_flag,*Z,} #[bg=colour237,fg=colour214,nobold,noitalics,nounderscore]"
set-window-option -g window-status-format "#[bg=colour239,fg=colour237,noitalics]#[bg=colour239,fg=colour223] #I #[bg=colour239,fg=colour223] #W #[bg=colour237,fg=colour239,noitalics]"
# vim: set ft=tmux tw=0 nowrap:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment