Created
March 21, 2022 18:03
-
-
Save dylan-sessler/781a2791c4f82157c3d7f252fa0d220e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Copy Mode (Vim Style) ### | |
# vim keys in copy and choose mode | |
set-window-option -g mode-keys vi | |
# copying selection vim style | |
# http://jasonwryan.com/blog/2011/06/07/copy-and-paste-in-tmux/ | |
# https://github.com/myfreeweb/dotfiles/blob/master/tmux.conf | |
bind-key -n M-k copy-mode # enter copy mode; default [ | |
bind-key -T copy-mode-vi y send-keys -X cursor-up; | |
bind-key -T copy-mode-vi Y send-keys -X -N 5 cursor-up; | |
bind-key -T copy-mode-vi n send-keys -X cursor-down; | |
bind-key -T copy-mode-vi N send-keys -X -N 5 cursor-down; | |
bind-key -T copy-mode-vi o send-keys -X cursor-left; | |
bind-key -T copy-mode-vi h send-keys -X cursor-right; | |
bind-key -T copy-mode-vi v send-keys -X begin-selection; | |
bind-key -T copy-mode-vi V send-keys -X select-line; | |
bind-key -T copy-mode-vi C-n send-keys -X clear-selection; | |
# rectangle-toggle (aka Visual Block Mode) > hit v then C-b to trigger it | |
bind-key -T copy-mode-vi C-r send-keys -X rectangle-toggle; | |
bind-key -T copy-mode-vi C-b send-keys v C-r; | |
bind-key -T copy-mode-vi k send-keys -X copy-pipe "xclip -in -selection clipboard" | |
# bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe "xclip -in -selection clipboard"; | |
# Make Home & End keys work in copy mode | |
bind-key -T copy-mode-vi 'Home' send -X start-of-line | |
bind-key -T copy-mode-vi 'End' send -X end-of-line | |
unbind-key -T copy-mode-vi C-e | |
unbind-key -T copy-mode-vi C-d |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment