Skip to content

Instantly share code, notes, and snippets.

@Icy-Thought
Created August 12, 2023 17:04
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 Icy-Thought/63f7e96283f0d208bc78f99142ec70b2 to your computer and use it in GitHub Desktop.
Save Icy-Thought/63f7e96283f0d208bc78f99142ec70b2 to your computer and use it in GitHub Desktop.
# ============================================= #
# Start with defaults from the Sensible plugin #
# --------------------------------------------- #
run-shell /nix/store/sjwqvdzdddxxbr87h5h7al7biipz50vj-tmuxplugin-sensible-unstable-2017-09-05/share/tmux-plugins/sensible/sensible.tmux
# ============================================= #
set -g default-terminal "tmux-256color"
set -g base-index 1
setw -g pane-base-index 1
new-session
set -g status-keys vi
set -g mode-keys vi
# rebind main key: C-a
unbind C-b
set -g prefix C-a
bind -N "Send the prefix key through to the application" \
C-a send-prefix
bind-key -N "Kill the current window" & kill-window
bind-key -N "Kill the current pane" x kill-pane
set -g mouse off
setw -g aggressive-resize off
setw -g clock-mode-style 24
set -s escape-time 0
set -g history-limit 5000
# ============================================= #
# Load plugins with Home Manager #
# --------------------------------------------- #
# tmuxplugin-resurrect
# ---------------------
set -g @resurrect-strategy-nvim 'session'
run-shell /nix/store/w9390lysqqmxw7mcckassvvxqk33c98y-tmuxplugin-resurrect-unstable-2022-05-01/share/tmux-plugins/resurrect/resurrect.tmux
# tmuxplugin-continuum
# ---------------------
set -g @continuum-restore 'on'
set -g @continuum-save-interval '60' # minutes
run-shell /nix/store/5zwmrg79l33nfc3kspvf4a7gddm0kf58-tmuxplugin-continuum-unstable-2022-01-25/share/tmux-plugins/continuum/continuum.tmux
# ============================================= #
# -------===[ Color Correction ]===------- #
set-option -ga terminal-overrides ",*256col*:Tc"
set-option -ga terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q'
set-environment -g COLORTERM "truecolor"
# -------===[ General-Configurations ]===------- #
set-option -g renumber-windows on
set-window-option -g automatic-rename on
set-window-option -g word-separators ' @"=()[]'
set-option -g mouse on
set-option -s focus-events on
set-option -g renumber-windows on
set-option -g allow-rename off
# -------===[ Activity/Sound ]===------- #
set-option -g bell-action none
set-option -g visual-bell off
set-option -g visual-silence off
set-option -g visual-activity off
set-window-option -g monitor-activity off
# -------===[ Status-Bar ]===------- #
set-option -g status on
set-option -g status-interval 1
set-option -g status-style bg=default,bold,italics
set-option -g status-position top
set-option -g status-justify left
set-option -g status-left-length "40"
set-option -g status-right-length "80"
# Messages:
set-option -g message-style fg="#1F1F28",bg="#957FB8",align="centre"
set-option -g message-command-style fg="#1F1F28",bg="#957FB8",align="centre"
# Panes:
set-option -g pane-border-style fg="#DCD7BA"
set-option -g pane-active-border-style fg="#76946A"
# Windows:
set-option -g window-status-format "#[fg=#DCD7BA] #W/#{window_panes} "
set-option -g window-status-current-format "#{?client_prefix,#[fg=#1F1F28]#[bg=#C34043] #I:#W #[fg=#C34043]#[bg=default],#[fg=#1F1F28]#[bg=#957FB8] #I:#W #[fg=#957FB8]#[bg=default]}"
# -------===[ Statusline ]===------- #
set-option -g status-left "#[fg=#1F1F28]#[bg=#6A9589]#[bold]  #[fg=#6A9589]#[bg=default]"
set-option -g status-bg default
set-option -g status-right "#[italics]∡ #H | %b %d, %H:%M #[fg=#1F1F28,bg=#72A7BC,bold,italics] base-#S "
# -------===[ Clock & Selection ]===------- #
set-window-option -g clock-mode-colour "#76946A"
set-window-option -g mode-style "fg=#1F1F28 bg=#957FB8 bold"
# -------===[ Keybindings ]===------- #
bind-key c clock-mode
# Window Control(s):
bind-key q kill-session
bind-key Q kill-server
bind-key t new-window -c '#{pane_current_path}'
# Buffers:
bind-key b list-buffers
bind-key p paste-buffer
bind-key P choose-buffer
# Split bindings:
bind-key - split-window -v -c '#{pane_current_path}'
bind-key / split-window -h -c '#{pane_current_path}'
# Copy/Paste bindings:
bind-key -T copy-mode-vi v send-keys -X begin-selection -N "Start visual mode for selection"
bind-key -T copy-mode-vi y send-keys -X copy-selection -N "Yank text into buffer"
bind-key -T copy-mode-vi r send-keys -X rectangle-toggle -N "Yank region into buffer"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment