Skip to content

Instantly share code, notes, and snippets.

@skoshy
Last active April 21, 2021 17:42
Show Gist options
  • Save skoshy/8ab966eeb02112aa33d07f804f441ff5 to your computer and use it in GitHub Desktop.
Save skoshy/8ab966eeb02112aa33d07f804f441ff5 to your computer and use it in GitHub Desktop.
#####
# Remember to `brew install reattach-to-user-namespace` for working copy support
# Also install tpm - git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
# and then install tpm plugins - https://github.com/tmux-plugins/tpm#installing-plugins
#####
# Plugins
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'tmux-plugins/tmux-yank'
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# Make opening new panes in the same directory
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind - split-window -c "#{pane_current_path}"
bind | split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
# Start windows and panes at 1, not 0
set -g base-index 1
setw -g pane-base-index 1
# reload config file (change file location to your the tmux.conf you want to use)
bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded"
# add hotkey to clear history
bind-key k send-keys -R C-l \; clear-history
# set scroll speed
bind-key -T copy-mode WheelUpPane send -N2 -X scroll-up
bind-key -T copy-mode WheelDownPane send -N2 -X scroll-down
# set inactive/active window styles
# set -g window-style 'fg=colour247,bg=colour233'
# set -g window-active-style 'fg=colour250,bg=black'
# pane border
# set -g pane-border-bg colour233
# set -g pane-border-fg colour243
# set -g pane-active-border-bg colour233
# set -g pane-active-border-fg colour243
# bottom bar
# set -g status-bg colour17
# set -g status-fg white
# Enable mouse mode (tmux 2.1 and above)
set -g mouse on
# Search mode
bind-key / copy-mode \; send-key C-s
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run -b '~/.tmux/plugins/tpm/tpm'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment