Skip to content

Instantly share code, notes, and snippets.

@neotohin
Created October 5, 2016 09:34
Show Gist options
  • Save neotohin/c5abe63fa1f20dbeec2761098f821b65 to your computer and use it in GitHub Desktop.
Save neotohin/c5abe63fa1f20dbeec2761098f821b65 to your computer and use it in GitHub Desktop.
Tmux Configuration
###########################
# Configuration
###########################
# use vim key bindings
setw -g mode-keys vi
# highlight window when it has new activity
setw -g monitor-activity on
set -g visual-activity on
#Evil mouse settings
##scroll buffer
set -g mouse on
# re-number windows when one is closed
set -g renumber-windows on
# shorten command delay
set -sg escape-time 1
###########################
# Key Bindings
###########################
# tmux prefix changing ctrl+b to ctrl+j
#unbind C-b
#set -g prefix C-j
# copy with 'enter' or 'y' and send to mac os clipboard: http://goo.gl/2Bfn8
unbind -t vi-copy Enter
bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
# create 'v' alias for selecting text
bind-key -t vi-copy v begin-selection
# paste
unbind C-p
bind C-p paste-buffer
# Provides most of the following configuration via tmux
# plugin 'tmux-plugins/tmux-pain-control'
# window splitting
# unbind %
# bind | split-window -h
# unbind '"'
# bind - split-window -v
# 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
# map Vi movement keys as pane movement keys
# bind h select-pane -L
# bind j select-pane -D
# bind k select-pane -U
# bind l select-pane -R
# quickly switch panes
unbind ^J
bind ^J select-pane -t :.+
# force a reload of the config file
# Now it comes within tmux sensible
#unbind r
#bind r source-file ~/.tmux.conf \; display "Reloaded!"
# Make the current window the first window
bind T swap-window -t 1
# Toggle Synchronize panes
bind-key s set-window-option synchronize-panes
###########################
# Status Bar
###########################
# Moving tmux statusbar on top
set -g status-position top
set -g status-justify centre # center window list for clarity
# show session, window, pane in left status bar
set -g status-left-length 40
set -g status-left '#[fg=green]#S#[fg=blue] #I:#P#[default]'
# show hostname, date, time, and battery in right status bar
#set-option -g status-right '#[fg=green]#H#[default] %m/%d/%y %I:%M\
#[fg=red]#(battery discharging)#[default]#(battery charging)'
set -g status-right '♪ #(exec amixer get Master | egrep -o "[0-9]+%" | egrep -o "[0-9]*") | ♥#(acpi | cut -d ',' -f 2) | %a %m-%d %H:%M'
# send C-q to send prefix in child tmux inside a tmux
bind-key -n C-q send-prefix
###########################
# Pane
###########################
# set color of active pane
set -g pane-border-fg colour235
set -g pane-border-bg black
set -g pane-active-border-fg blue
set -g pane-active-border-bg black
#------------
# tabs
#------------
setw -g window-status-format "#[fg=white]#[bg=blue] #I #[bg=blue]#[fg=white] #W "
setw -g window-status-current-format "#[bg=brightmagenta]#[fg=white] *#I #[fg=white,bold]#[bg=cyan] [#W] "
# setw -g window-status-content-attr bold,blink,reverse
###########################
# Colors
###########################
# color status bar
set -g status-bg colour235
set -g status-fg white
# highlight current window
set-window-option -g window-status-current-fg black
set-window-option -g window-status-current-bg green
###########################
# List of plugins
###########################
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-pain-control'
#set -g @plugin 'tmux-plugins/tmux-resurrect'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
##############################
### Color & Style Settings ###
##############################
# source ~/.bin/dotfiles/tmux/theme.conf
################################
# Shortcuts
################################
# Sessions
#
# :new<CR> new session
# s list sessions
# $ name session
# Windows (tabs)
#
# c new window
# w list windows
# f find window
# , name window
# & kill window
# Panes (splits)
#
# % vertical split
# " horizontal split
#
# o swap panes
# q show pane numbers
# x kill pane
# + break pane into window (e.g. to select text by mouse to copy)
# - restore pane from window
# ⍽ space - toggle between layouts
# PREFIX q (Show pane numbers, when the numbers show up type the key to goto that pane)
# PREFIX { (Move the current pane left)
# PREFIX } (Move the current pane right)
# Misc
#
# d detach
# t big clock
# ? list shortcuts
# : prompt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment