Skip to content

Instantly share code, notes, and snippets.

@anistark
Last active September 21, 2026 03:58
Show Gist options
  • Select an option

  • Save anistark/1f686bab54e93d1941f9 to your computer and use it in GitHub Desktop.

Select an option

Save anistark/1f686bab54e93d1941f9 to your computer and use it in GitHub Desktop.
Tmux Conf
# Tmux Config
tm() { tmux new -s "$1" ;}
ta() { tmux attach -t "$1"; }
tl() { tmux list-sessions; }
tn() { tmux new-window; }
Setting up tmux directly
```
curl -fsSL -o ~/.tmux.conf https://gist.githubusercontent.com/anistark/1f686bab54e93d1941f9/raw/tmux.conf
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
~/.tmux/plugins/tpm/bin/install_plugins
```
The tokyo-night theme needs a Nerd Font set in the terminal, plus on macOS:
```
brew install bash gawk gnu-sed
```
Inside tmux, `prefix + I` installs plugins and `prefix + U` updates them.
# Terminal
set -g default-terminal "tmux-256color"
set -ga terminal-overrides ",xterm-256color:RGB"
set -s escape-time 0
set -g history-limit 50000
# Change key-bindings for moving control between panes
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# Alt-n for new window
bind -n M-n new-window
# Alt-r for renaming window
bind -n M-r command-prompt "rename-window '%%'"
# Prefix + Ctrl-t to jump to last window
bind C-t last-window
# Window switching using Shift + Left / Right arrow
bind -n S-Left previous-window
bind -n S-Right next-window
# Swap window with left/right (tmux 3+ no longer follows the moved window, so select it)
bind -n S-Up swap-window -t -1 \; select-window -t -1
bind -n S-Down swap-window -t +1 \; select-window -t +1
# Enable mouse (pane selection, resize, scroll)
# set -g mouse on
# Monitor events happening on other windows
setw -g monitor-activity on
set -g visual-activity on
# Start window and pane numbering from 1 instead of 0
set -g base-index 1
setw -g pane-base-index 1
set -g renumber-windows on
# Aggressive resize
setw -g aggressive-resize on
# Theme: tokyo-night (needs a Nerd Font in the terminal)
set -g @tokyo-night-tmux_theme night
set -g @tokyo-night-tmux_window_id_style fsquare
set -g @tokyo-night-tmux_show_git 1
set -g @tokyo-night-tmux_show_path 1
set -g @tokyo-night-tmux_date_format YMD
set -g @tokyo-night-tmux_time_format 24H
# Sane scrolling (disable alternate screen so output lands in the terminal scrollback)
set -ga terminal-overrides ',xterm*:smcup@:rmcup@'
# Reload config with prefix + r
bind r source-file ~/.tmux.conf \; display "tmux.conf reloaded"
# Plugins (TPM: prefix + I to install, prefix + U to update)
set -g @plugin "tmux-plugins/tpm"
set -g @plugin "janoamaral/tokyo-night-tmux"
run "~/.tmux/plugins/tpm/tpm"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment