Skip to content

Instantly share code, notes, and snippets.

@kolach
Last active December 25, 2016 01:27
Show Gist options
  • Save kolach/e123d648be2fb0e550cc to your computer and use it in GitHub Desktop.
Save kolach/e123d648be2fb0e550cc to your computer and use it in GitHub Desktop.
# Remap prefix
set -g prefix C-a
unbind C-b
# We’ve remapped Ctrl-a as our Prefix, but programs such as Vim, Emacs,
# and even the regular Bash shell also use that combination.
# We need to configure tmux to let us send that command through when we need it
bind C-a send-prefix
# tmux adds a very small delay when sending commands,
# and this delay can interfere with other programs such as the Vim text editor
# issue keystrokes without delay
set -sg escape-time 0
# set windows index from 1
set -g base-index 1
# set the starting index for panes
setw -g pane-base-index 1
# shotcut tp reload config file
bind r source-file ~/.tmux.conf \; display "Reloaded!"
bind z detach
bind e list-windows
# shortcut to split panes
bind \ split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
# new window with name prompt, opens window in current pane directory
bind c command-prompt -p "window name:" "new-window -c '#{pane_current_path}'; rename-window '%%'"
# moving between panes
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# 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
# Quick pane selection
bind -r C-h select-window -t :-
bind -r C-l select-window -t :+
# Maximize and restore a pane
#unbind Up
#bind Up new-window -d -n tmp \; swap-pane -s tmp.1 \; select-window -t tmp
#unbind Down
#bind Down last-window \; swap-pane -s tmp.1 \; kill-window -t tmp
# configure tmux to use mouse
# setw -g mode-mouse on
# make tmux display things in 256 colors
#set -g default-terminal "screen-256color"
set -g default-terminal "tmux-256color"
#set -g default-terminal "tmux"
# style statusbar
#set -g status-fg white
#set -g status-bg black
# style regular windows
#setw -g window-status-fg cyan
#setw -g window-status-bg default
#setw -g window-status-attr dim
# style active window
#setw -g window-status-current-fg white
#setw -g window-status-current-bg red
#setw -g window-status-current-attr bright
## command line colors
set -g message-fg white
set -g message-bg colour166 # orange
#set -g message-attr bright
# to be notified when something happens in one of the other windows
# in our session so we can react to it
setw -g monitor-activity on
set -g visual-activity on
# status bar customizations
# set -g status-left-length 40
# set -g status-left "#[fg=green]#S #[fg=yellow]#I #[fg=cyan]#P "
#set -g status-right "#{battery_icon} #{battery_percentage} #[fg=green]@#H #[fg=cyan]%d %b %R"
# set -g status-justify centre
#set -g status-utf8 on
# use zsh as a default shell
set -g default-shell /bin/zsh
# use vi mode to work with buffers
setw -g mode-keys vi
# set the tmux window option xterm-keys so that tmux will pass these keys through to its terminals
set-window-option -g xterm-keys on
# Set terminal titles by session name
set -g set-titles on
set -g set-titles-string '#S'
# If you have gaps in windows numbers, this command will reorder them
bind R \
move-window -r\; \
display-message "Windows reordered..."
# or it can be done automatically
set -g renumber-windows on
# list of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
#set -g @plugin 'tmux-plugins/tmux-battery'
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'
#if-shell 'env "$POWERLINE_CONFIG_COMMAND" tmux setup' '' 'run-shell "powerline-config tmux setup"'
run-shell "powerline-config tmux setup"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment