Last active
August 31, 2023 20:31
-
-
Save zfz/3bd4b59d526437a8e13f 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
| setw -g mode-keys vi | |
| # Switch panels | |
| bind k selectp -U # switch to panel Up | |
| bind j selectp -D # switch to panel Down | |
| bind h selectp -L # switch to panel Left | |
| bind l selectp -R # switch to panel Right | |
| # History limit | |
| set-option -g history-limit 10000 | |
| # Display 256color for Vim | |
| set -g default-terminal "screen-256color" | |
| # Vi copy: https://dev.to/iggredible/the-easy-way-to-copy-text-in-tmux-319g | |
| bind -T copy-mode-vi v send -X begin-selection | |
| bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy" | |
| bind P paste-buffer | |
| bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy" | |
| # Steps to copy and paste | |
| # - Add setw -g mode-keys vi in your tmux config | |
| # - Ctrl + [ to enter tmux vi copy mode | |
| # - Move around with vim navigation keys | |
| # - Begin highlight with Space | |
| # - Copy with Enter | |
| # - Paste with Ctrl + ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment