Skip to content

Instantly share code, notes, and snippets.

@justinleveck
Last active August 26, 2020 21:02
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 justinleveck/4db42a1d6ccc956fa2442a9f44641645 to your computer and use it in GitHub Desktop.
Save justinleveck/4db42a1d6ccc956fa2442a9f44641645 to your computer and use it in GitHub Desktop.
tmux conf for remote shell
## Use reattach-to-user-namespace as the wrapper script to handle Mac OS X
## support for pbcopy and pbpaste.
#set -g default-shell /usr/bin/zsh
set -g default-command "${SHELL}"
## Tell tmux to copy these environment variables over from the original shell
## that tmux was launched in. These are important for ssh-agent on mac os x to
## work properly when inside your tmux sessions. Otherwise, it will make you
## type in your key password when trying to ssh to different machines.
set-option -g update-environment "SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION"
## Tell tmux to set the history limit to 100,000 lines.
set-option -g history-limit 100000
## set -g default-terminal "screen-256color"
set -g default-terminal "screen"
## tell Tmux that outside terminal supports true color
set -ga terminal-overrides ",xterm-256color*:Tc"
setw -g xterm-keys on
set -g display-panes-time 800 # slightly longer pane indicators display time
set -g display-time 1000 # slightly longer status messages display time
set -g status-interval 10 # redraw status line every 10 seconds
## Add binding to reload tmux.conf for fast, iterative development
bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded"
## Enable VI mode in the buffer mode. This allows use to move around like we
## are in VIM and do searches, etc.
setw -g mode-keys vi
## Make the escape-time delay a bit more responsive so it doesn't screw with
## Vim.
set -s escape-time 1
## Rebind horizontal and vertical splits to keys I can remember. Also, set the
## path for new splits to that of the current pane.
bind-key - split-window -v -c '#{pane_current_path}'
bind-key \ split-window -h -c '#{pane_current_path}'
## Rebind new window to current path
bind c new-window -c "#{pane_current_path}"
## Switch between two latests windows
set-option -g prefix C-b
bind-key C-b last-window
## Set window number to start from 1 instead of default of 0
set-option -g base-index 1
## Enable renumbering of windows
set-option -g renumber-windows on
## Enable mouse scrolling
set-window-option -g mode-mouse on
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment