Skip to content

Instantly share code, notes, and snippets.

@NeodymiumPhish
Created May 21, 2020 15:18
Show Gist options
  • Save NeodymiumPhish/ff184e842a3b9a602795ba505d916393 to your computer and use it in GitHub Desktop.
Save NeodymiumPhish/ff184e842a3b9a602795ba505d916393 to your computer and use it in GitHub Desktop.
Tmux Config (Dvorak)
# scrollback size
set -g history-limit 10000
################################
# Keybinds
###############################
# Changing ctrl b to ctrl a as the command button
unbind C-b
set -g prefix C-a
# set first window to index 1 (not 0) to map more to the keyboard layout
set -g base-index 1
set -g pane-base-index 1
# pass through xterm keys
set -g xterm-keys on
# Keep your finger on ctrl, or don't, same result
bind-key C-d detach-client
bind-key C-p paste-buffer
# Redraw the client (if interrupted by wall, etc)
bind R refresh-client
# reload tmux config with ctrl + a + r
unbind r
bind r \
source-file ~/.tmux.conf \;\
display 'Reloaded tmux config.'
# Vertical splits with g or C-g
unbind g
unbind C-g
bind-key g split-window -h
bind-key C-g split-window -h
# Horizontal splits with v or C-h
unbind h
unbind C-h
bind-key h split-window
bind-key C-h split-window
# Ctrl + a + o rename window
unbind o
unbind C-o
bind-key C-o rename-window
bind-key o rename-window
# Using the mouse to switch panes
set -g mouse-utf8 on
set -g mouse on
# Ctrl - t or t new window
unbind t
unbind C-t
bind-key t new-window
bind-key C-t new-window
# Ctrl - w or w to kill panes
unbind w
unbind C-w
bind-key w kill-pane
bind-key C-w kill-pane
# C + control q to kill session
unbind q
unbind C-q
bind-key q kill-session
bind-key C-q kill-session
# Switching panes with alt
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
# Ctrl + a + n : New session
unbind n
unbind C-n
bind-key n new-session
bind-key C-n new-session
# Pagedown : Next window
#unbind Pagedown
unbind Pagedown
bind -n C-Pagedown next-window
# Ctrl + a + Pagup : Previous window
#unbind Pageup
unbind Pageup
bind -n C-Pageup previous-window
# Zoom with ctrl + a + ctrl + '+'
#unbind C-+
#bind C-+ \
#new-window -d -n tmux-zoom 'clear && echo TMUX ZOOM && read'\;\
#swap-pane -s tmux-zoom.0 \;\
#select-window -t tmux-zoom
# Zoom back ctrl + a + ctrl + '-'
#unbind C--
#bind C-- \
# last-window \;\
# swap-pane -s tmux-zoom.0 \;\
# kill-window -t tmux-zoom
# Visual Activity Monitoring between windows
setw -g monitor-activity on
set -g visual-activity on
# Show tmux positions in titles
set -g set-titles on
# Set up a basic panel structure for command + ctr D
bind D source-file ~/.tmux/dev
# Attach to a session if runs otherwise create a new one
new-session -n $HOST
# Copy from tmux to system clipboard
# Needs xclip -> sudo apt install xclip
bind -T vi-copy y copy-pipe "xclip -sel clip -i"
#####################################
# Support 256 color
set -g default-terminal "tmux-256color"
#####################################
# Plugins
#https://github.com/tmux-plugins/tpm
####################################
#####################################
# tpm plugin manager
# https://github.com/tmux-plugins/tpm
#####################################
set -g @plugin 'tmux-plugins/tpm'
#####################################
# tmux-sensible - basline settings that get overwritten from .tmux.conf
# https://github.com/tmux-plugins/tmux-sensible
######################################
set -g @plugin 'tmux-plugins/tmux-sensible'
#####################################
# tmux-resurrect - save and reload sessions and windows after a restart
# https://github.com/tmux-plugins/tmux-resurrect
# Default keybinds : save - command + c + s && restore command + c + r
######################################
set -g @plugin 'tmux-plugins/tmux-resurrect'
### tmux-resurrect extra settings ###
# keep vim sessions after reboot
set -g @resurrect-strategy-vim 'session'
# keep pane contents
set -g @resurrect-capture-pane-contents 'on'
# restore bash history
set -g @resurrect-save-bash-history 'on'
### /tmux-resurrect extra settings ###
######################################
# tmux-continuum - automatically save and restore tmux sessions
# https://github.com/tmux-plugins/tmux-continuum
#####################################
set -g @plugin 'tmux-plugins/tmux-continuum'
# Restore last saved enviroment
set -g @continuum-restore 'on'
# Set autosave interval
set -g @continuum-save-interval '5'
# Show continiuum state in statusbar
#set -g status-right 'Continuum status: #{continuum_status}'
# Starting tmux with system https://github.com/tmux-plugins/tmux-continuum/blob/master/docs/automatic_start.md
######################################
# tmux-yank - advanced copy mode
# https://github.com/tmux-plugins/tmux-yank
#####################################
set -g @plugin 'tmux-plugins/tmux-yank'
# 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