Skip to content

Instantly share code, notes, and snippets.

@tgroshon
Last active November 10, 2019 01:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tgroshon/776163eb0f839601fedcfd464bdeedba to your computer and use it in GitHub Desktop.
Save tgroshon/776163eb0f839601fedcfd464bdeedba to your computer and use it in GitHub Desktop.
Tmux configuration (expected linux)
# 256 colors for vim
set -g default-terminal "xterm"
# Vim Keybindings
setw -g mode-keys vi
# Status bar position
set-option -g status-position top
# Prefix key
unbind C-b
set -g prefix C-Space
bind C-Space send-prefix
# Vim Copy Mode
unbind [
unbind -T copy-mode-vi Enter
bind-key Escape copy-mode
bind-key C-p paste-buffer
bind-key -T copy-mode-vi 'V' send -X rectangle-toggle
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel
# For Linux install xclip
bind-key -T copy-mode-vi Enter send -X copy-pipe-and-cancel "xclip -sel clip"
# For MacOS install "reattach-to-user-namespace" with homebrew
# bind-key -T copy-mode-vi Enter send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
# Quick kill
bind-key C-q kill-window
# Reload config with a key
bind-key r source-file ~/.tmux.conf \; display "Config reloaded!"
# Open panes in same location
bind-key s split-window -c "#{pane_current_path}"
bind-key v split-window -h -c "#{pane_current_path}"
# Quick Navigation
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
# # Mouse works as expected
# set -g mode-mouse on
# set -g mouse-select-pane on
# set -g mouse-resize-pane on
# set -g mouse-select-window on
# Scrolling works as expected
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment