Created
July 21, 2023 16:20
-
-
Save bouyagas/d95093520629c665e176eb56e4dd1c52 to your computer and use it in GitHub Desktop.
tmux confire
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Default termtype. If the rcfile sets $TERM, that overrides this value. | |
# Add truecolor support | |
set-option -g default-terminal "screen-256color" | |
set-option -sa terminal-features ',xterm-256color:RGB' | |
# support logging out and back in | |
set -g update-environment "SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION" | |
# vi mode | |
set-window-option -g mode-keys vi | |
# if run as "tmux attach", create a session if one does not already exist | |
new-session -n $HOST | |
# set default shell | |
set -g default-shell /bin/bash | |
# disable mouse | |
set -g mouse off | |
# Set the prefix to ^A. | |
unbind C-b | |
set -g prefix ^A | |
bind a send-prefix | |
# Open new stuff with correct CWD | |
#hsplit | |
unbind '"' | |
bind | split-window -h -c "#{pane_current_path}" | |
#vsplit | |
unbind % | |
bind - split-window -v -c "#{pane_current_path}" | |
# bind c new-window -c "#{pane_current_path}" \; split-window -h -c "#{pane_current_path}" \; select-pane -L | |
# smart pane switching with awareness of vim splits | |
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-h) || tmux select-pane -L" | |
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-j) || tmux select-pane -D" | |
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-k) || tmux select-pane -U" | |
bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-l) || tmux select-pane -R" | |
bind C-l send-keys 'C-l' | |
# shortcuts | |
bind - split-window -l 20 -c "#{pane_current_path}" | |
bind _ split-window -l 20 -c "#{pane_current_path}" node | |
# ---------------------- | |
# Status Bar | |
# ----------------------- | |
set-option -g status on # turn the status bar on | |
set -g status-interval 2 # set update frequencey (default 15 seconds) | |
set -g status-justify centre # center window list for clarity | |
set-option -g status-position top # position the status bar at top of screen | |
# visual notification of activity in other windows | |
setw -g monitor-activity on | |
set -g visual-activity on | |
# show session name, window & pane number, date and time on right side of | |
# status bar | |
set -g status-right "%b %d %Y @ %l:%M %p" | |
# split automatically on startup | |
split-window -h -c "#{pane_current_path}" | |
select-pane -L | |
# control automatic window renaming | |
set-window-option -g automatic-rename on # auto name | |
setw -g automatic-rename | |
# list all paste buffers (default key is '#') | |
bind-key b list-buffers | |
# choose buffer to paste interactively (default key was '=') | |
bind-key p choose-buffer | |
# delete the most recently copied buffer of text (default key was '-') | |
bind-key x delete-buffer | |
# scrolling with terminal scroll bar | |
set -g terminal-overrides 'xterm*:smcup@:rmcup@' | |
# Panes | |
bind up resize-pane -U 5 | |
bind down resize-pane -D 5 | |
bind left resize-pane -L 5 | |
bind right resize-pane -R 5 | |
bind tab next-layout | |
unbind C-o | |
bind r rotate-window | |
bind space select-pane -t:.+ | |
# kill current pane/window | |
bind-key q confirm-before kill-pane | |
bind-key Q confirm-before kill-window | |
# Monitor Activity | |
bind m set-window-option monitor-activity | |
# window title | |
# enable wm window titles | |
set-option -g set-titles on | |
# wm window title string (uses statusbar variables) | |
set-option -g set-titles-string '#S:#I.#P #W' # window number,program name,active (or not) | |
# Patch for OS X pbpaste and pbcopy under tmux. | |
#set-option -g default-command "which reattach-to-user-namespace > /dev/null && reattach-to-user-namespace -l $SHELL || $SHELL" | |
# color scheme (styled as vim-powerline) | |
set -g status-left-length 52 | |
set -g status-right-length 451 | |
set -g status-fg white | |
set -g status-bg "#333945" | |
# set -g status-left '#[fg=colour235,bg=colour252,bold] â #S #[fg=colour252,bg=colour238,nobold]⮀#[fg=colour245,bg=colour238,bold] #(whoami) #[fg=colour238,bg=colour234,nobold]⮀' | |
# set -g window-status-format "#[fg=colour235,bg=colour252,bold] #I #W " | |
# set -g window-status-current-format "#[fg=colour234,bg=colour39]⮀#[fg=black,bg=colour39,noreverse,bold] #I: #W #[fg=colour39,bg=colour234,nobold]⮀" | |
# Pane resize in all four directions using vi bindings. | |
# Can use these raw but I map them to shift-ctrl-<h,j,k,l> in iTerm. | |
bind-key J resize-pane -D | |
bind-key K resize-pane -U | |
bind-key H resize-pane -L | |
bind-key L resize-pane -R | |
# easily toggle synchronization (mnemonic: e is for echo) | |
# sends input to all panes in a given window. | |
bind e setw synchronize-panes on | |
bind E setw synchronize-panes off | |
# No escape time for vi mode | |
set -sg escape-time 0 | |
# Screen like binding for last window | |
unbind l | |
bind C-a last-window | |
# Bigger history | |
set -g history-limit 10000 | |
# Reload key | |
unbind R | |
bind R source-file ~/.tmux.conf | |
# List of plugins | |
set -g @plugin "arcticicestudio/nord-tmux" | |
set -g @plugin 'tmux-plugins/tpm' | |
set -g @plugin 'tmux-plugins/tmux-sensible' | |
set -g @plugin 'tmux-plugins/tmux-resurrect' | |
set -g @plugin 'tmux-plugins/tmux-continuum' | |
set -g @plugin 'tmux-plugins/tmux-yank' | |
set -g @plugin 'tmux-plugins/tmux-open' | |
set -g @plugin 'tmux-plugins/tmux-copycat' | |
set -g @plugin 'tmux-plugins/tmux-pain-control' | |
set -g @plugin 'tmux-plugins/tmux-prefix-highlight' | |
set -g @plugin 'tmux-plugins/tmux-sidebar' | |
set -g @plugin 'tmux-plugins/tmux-sessionist' | |
set -g @plugin 'tmux-plugins/tmux-online-status' | |
set -g @plugin 'tmux-plugins/tmux-net-speed' | |
set -g @plugin 'tmux-plugins/tmux-logging' | |
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) | |
run '~/.tmux/plugins/tpm/tpm' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment