Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# Set vi key bindings mode
set -g mode-keys vi
set -g status-keys vi
# Set new panes to open in current directory
bind c new-window -c "#{pane_current_path}"
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'dracula/tmux'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
# Config Dracula Theme
set -g @dracula-show-fahrenheit false
set -g @dracula-show-powerline true
set -g @dracula-show-network false
set -g @dracula-show-left-icon session
set -g @dracula-cpu-usage true
set -g @dracula-ram-usage true
set -g @dracula-day-month true
set -g @dracula-military-time true
set -g @dracula-show-flags true
# Set 256 colors
set -s default-terminal 'tmux-256color'
# switch panes using Alt-arrow without prefix
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
# swap windows with shift+arrow with prefix
bind-key S-Left swap-window -t -1
bind-key S-Right swap-window -t +1
# copy from tmux to clipboard
bind-key -T copy-mode-vi y send-keys -X copy-pipe "xclip -r" \; display-message "Copied to selection"
bind-key -T copy-mode-vi Y send-keys -X copy-pipe "xclip -r -selection clipboard" \; display-message "Copied to clipboard"
bind-key C-p run-shell "xclip -o | tmux load-buffer - && tmux paste-buffer"
# turn mouse on
set -g mouse on
# restore vim sessions
set -g @resurrect-strategy-vim 'session'
# restore neovim sessions
set -g @resurrect-strategy-nvim 'session'
# restore panes
set -g @resurrect-capture-pane-contents 'on'
# restore last saved environment (automatically)
set -g @continuum-restore 'on'
# reload config file (change file location to your the tmux.conf you want to use)
bind r source-file ~/.tmux.conf
# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin 'git@github.com:user/plugin'
# set -g @plugin 'git@bitbucket.com:user/plugin'
# 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