Skip to content

Instantly share code, notes, and snippets.

@jeffkreeftmeijer
Created August 9, 2017 09:20
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 jeffkreeftmeijer/b3dcb4ddf47923c34e75e4e5a4d3188e to your computer and use it in GitHub Desktop.
Save jeffkreeftmeijer/b3dcb4ddf47923c34e75e4e5a4d3188e to your computer and use it in GitHub Desktop.
# Use Ctrl-a instead of Ctrl-b as the tmux prefix
set-option -g prefix C-a
# Set the base index to 1 instead of 0 for both windows and panes.
set-option -g base-index 1
set-option -g pane-base-index 1
# Use vim keybindings in copy mode
setw -g mode-keys vi
# Setup 'v' to begin selection as in Vim
bind-key -t vi-copy v begin-selection
bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
# Update default binding of `Enter` to also use copy-pipe
unbind -t vi-copy Enter
bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
# Bind ']' to use pbpaste
bind ] run "reattach-to-user-namespace pbpaste | tmux load-buffer - && tmux paste-buffer"
# Open new windows and splits in the current path
bind-key c new-window -c "#{pane_current_path}"
bind-key % split-window -h -c "#{pane_current_path}"
bind-key '"' split-window -v -c "#{pane_current_path}"
# List of plugins
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tpm'
run '~/.tmux/plugins/tpm/tpm'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment