# ~/.tmux.conf########################################################################### # Change prefix from default (C-b) to C-g # C-g doesn't interfere with emacs-style editing keys unbind -n C-b unbind -n C-g set -g prefix C-g # C-g C-g to passthrough a C-g unbind C-g bind C-g send-key C-g ########################################################################### # General options # Default termtype. If the rcfile sets $TERM, that overrides this value. set -g default-terminal screen-256color # Ring the bell if any background window rang a bell set -g bell-action any # Watch for activity in background windows setw -g monitor-activity on # scrollback size set -g history-limit 10000 # set first window to index 1 (not 0) to map more to the keyboard layout set -g base-index 1 setw -g pane-base-index 1 # pass through xterm keys set -g xterm-keys on ########################################################################### # General keymap # Keep your finger on ctrl, or don't, same result bind-key C-d detach-client bind-key C-p paste-buffer # Redraw the client (if interrupted by wall, etc) bind R refresh-client # reload tmux config unbind r bind r \ source-file ~/.tmux.conf \;\ display 'Reloaded tmux config.' # Use emacs keybindings for tmux commandline input. # (Note: if in vi mode, to get command mode you need to hit ESC twice.) set -g status-keys emacs # Use vi keybindings in copy and choice modes setw -g mode-keys vi ########################################################################### # Window management / navigation # move between windows bind-key C-h previous-window bind-key C-l next-window # C-\ (no prefix) to skip to last window we were in before this one bind -n "C-\\" last-window # C-Space (no prefix) to tab to next window # bind -n C-Space next-window ########################################################################### # Pane management / navigation # Horizontal splits with s or C-s unbind s unbind C-s bind-key s split-window bind-key C-s split-window # Vertical split with v or C-v unbind v unbind C-v bind-key v split-window -h bind-key C-v split-window -h # navigation with C-{h,j,k,l} -- NO PREFIX # https://gist.github.com/mislav/5189704 bind -n C-k run-shell 'tmux-vim-select-pane -U' bind -n C-j run-shell 'tmux-vim-select-pane -D' bind -n C-h run-shell 'tmux-vim-select-pane -L' bind -n C-l run-shell 'tmux-vim-select-pane -R' # C-g C-k to passthrough a C-k # C-k is consumed for pane navigation but we want it for kill-to-eol unbind C-k bind C-k send-key C-k # Pane resize in all four directions using vi bindings. # Can use these raw but I map them to Cmd-Opt- in iTerm2. # http://tangledhelix.com/blog/2012/04/28/iterm2-keymaps-for-tmux/ # Note on a few prefix options: C-a = 0x01, C-b = 0x02, C-g = 0x06 bind-key J resize-pane -D bind-key K resize-pane -U bind-key H resize-pane -L bind-key L resize-pane -R # easily toggle synchronization (mnemonic: e is for echo) # sends input to all panes in a given window. bind e setw synchronize-panes on bind E setw synchronize-panes off ########################################################################### # Scrollback / pastebuffer # Vim-style copy/paste unbind [ bind y copy-mode unbind p bind p paste-buffer # bind -t vi-copy v begin-selection # bind -t vi-copy y copy-selection # bind -t vi-copy Escape cancel ########################################################################### # Mouse mode is on by default. # M -- to turn it off # m -- to turn it on # # As of tmux 2.1, a backward-incompatible change was introduced. # mode-mouse and mouse-* no longer exist, replaced by simply # mouse . Which is great, and easier, but unfortunately I use # tmux on systems which I don't foresee going to 2.1+ anytime soon. # So, time to test versions... this is kind of cheap and hacky, and it # won't work for 2.2 and beyond, but will work for now. I tried to make # this more generalized but have not been successful so far. # # set -g mouse-utf8 on set -g mouse on # if-shell '[[ $(echo "$(tmux -V | cut -d" " -f2) >= 2.1" | bc) -eq 1 ]]' \ # 'set -g mouse on; bind m set -g mouse on \; display "Mouse ON"; bind M set -g mouse off \; display "Mouse OFF"' \ # 'set -g mode-mouse on; set -g mouse-resize-pane on; set -g mouse-select-pane on; set -g mouse-select-window on; bind m set -g mode-mouse on \; set -g mouse-resize-pane on \; set -g mouse-select-pane on \; set -g mouse-select-window on \; display "Mouse ON"; bind M set -g mode-mouse off \; set -g mouse-resize-pane off \; set -g mouse-select-pane off \; set -g mouse-select-window off \; display "Mouse OFF"' ########################################################################### set -g @nord_tmux_no_patched_font "1" run-shell "~/.tmux/themes/nord-tmux/nord.tmux"