dotfiles/tmux/tmux.conf
2017-07-28 18:41:47 -04:00

136 lines
2.9 KiB
Bash

############
######
# Tmux Configuration for niblock
###
############
# Remap the prefix, but not to C-A incase we need to screen
set-option -g prefix C-b
# Set default terminal, colors, and encoding
set -g default-terminal "screen-256color"
setw -g utf8 on
#start window numbers at 1
set -g base-index 1
setw -g pane-base-index 1
#renumber windows sequentially after closing any of them
set -g renumber-windows on
#change default delay to be a bit more responsive
set -sg escape-time 0
#amount of time for which messages/indicators are displayed (in ms)
set -g display-time 2000
######
# Mouse
###
#setw -g mode-mouse on
#set -g mouse-select-pane on
set -g mouse on
######
# Colors
###
## Status Bar and Related Items
# Bar itself
set -g status-fg cyan
set -g status-bg black
# Window list
setw -g window-status-fg cyan
setw -g window-status-bg default
setw -g window-status-attr dim
setw -g window-status-current-fg white
setw -g window-status-current-bg black
setw -g window-status-current-attr bright
## Pane Dividers
set -g pane-border-fg black
set -g pane-border-bg black
set -g pane-active-border-fg colour51
set -g pane-active-border-bg black
## Command Line
set -g message-fg red
set -g message-bg black
set -g message-attr bright
######
# Status Line
###
set -g status-utf8 on
setw -g monitor-activity on
set -g visual-activity off
set -g allow-rename off
set -g status-left-length 40
set -g status-left "#[bright][ #S ] "
set -g status-right-length 80
set -g status-right "#(ruby ~/.dotfiles/tmux/clocks.rb)"
set -g window-status-format '#[bg=black,fg=cyan] #I #[bg=default]'
set -g window-status-current-format '#[fg=black,bg=cyan]#[fg=bright] #I '
######
# Keybinds
###
# Act like vim
setw -g mode-keys vi
# Pane movement
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Window movement
bind-key -r C-h select-window -t :-
bind-key -r C-l select-window -t :+
# Pane resizing
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
# Split window and fix path for tmux 1.9
bind | split-window -h #-c "#{pane_current_path}"
bind - split-window -v #-c "#{pane_current_path}"
# Reload config file
bind r source-file ~/.tmux.conf \; display "Config Reloaded!"
# Capture a pane into file for uploading to Gist
# bind-key u capture-pane \; save-buffer /tmp/tmux-buffer
# Captur selection, create a gist from it
#bind-key -tvi-copy u copy-pipe "~/Workbench/dotfiles/tmux/copy_selected.sh"
bind-key -tvi-copy u copy-pipe "ruby ~/Lab/gist_gem.rb -"
######
# Plugins
###
# TPM - Tmux Plugin Manager
# Install Plugins: <C-b> + I
# Uninstall Plugins: <C-b> + <Alt-u>
# Update Plugins: <C-b> + U
set -g @plugin 'tmux-plugins/tpm'
# Resurrect sessions
# Save: <C-b> + <C-s>
# Restore: <C-b> + <C-r>
set -g @plugin 'tmux-plugins/tmux-resurrect'
# Allow for scroll-wheel copy mode
set -g @plugin 'nhdaly/tmux-scroll-copy-mode'
# Run TPM
run '~/.tmux/plugins/tpm/tpm'