-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
101 lines (85 loc) · 3.57 KB
/
.tmux.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#
# .tmux.conf
# tmux configuration
#
# Enable mouse support
set -g mouse on
# After copying with the mouse, remain in copy mode.
set -g @yank_action 'copy-pipe' # or 'copy-pipe-and-cancel' for the default
set-option -g prefix C-a
set -g default-terminal "screen-256color"
# Open new windows/panes in current working directory
bind '"' split-window -c "#{pane_current_path}"
bind '%' split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
# Turn on bells from other windows
set-window-option -g visual-bell on
set-window-option -g bell-action other
# Move panes up/down/left/right like vim
bind h select-pane -L
bind l select-pane -R
bind j select-pane -D
bind k select-pane -U
# Yank to system clipboard with xclip installed.
# I'm doing this with the tmux-yank plugin instead.
# (1) Prefix then y captures the current tmux buffer into the system clipboard
#bind y run "tmux save-buffer - | xclip -i -sel clipboard"
# (2) Prefix then p pastes from the system clipboard into the current tmux session
#bind p run "tmux set-buffer $(xclip -o -sel clipboard); tmux paste-buffer;"
# Alternative bindings:
#bind -T copy-mode-vi y send -X copy-pipe 'xclip -in -selection clipboard'
#bind -n M-p run "xclip -o -selection clipboard | tmux load-buffer - ; tmux paste-buffer"
# Make copy mode like vi
setw -g mode-keys vi
# Swap windows left/right with ctl+shift+[left|right]
# https://superuser.com/a/552493/1061556
bind-key -n C-S-Left swap-window -t -1\; select-window -t -1
bind-key -n C-S-Right swap-window -t +1\; select-window -t +1
# Install tmux plugins manager (tmp) with:
# git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
# Enable tmux plugin manager:
# Copied from https://github.com/tmux-plugins/tpm
# List of plugins
# Load plugins with:
# prefix+I (that is a capital i as in Install)
# Update plugins:
# prefix+U (capital U as in Update)
# Remove/uninstall plugins not in the current plugin list:
# prefix+alt+u (lowercase u as in uninstall)
##########################
# tpm (tmux plugin manager)
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
##########################
##########################
# tmux-yank
# https://github.com/tmux-plugins/tmux-yank
set -g @plugin 'tmux-plugins/tmux-yank'
# Default for yank selection is clipboard, so no need to change it
#set -g @yank_selection 'primary' # or 'secondary' or 'clipboard'
# Set mouse to yank to clipboard; default is primary
set -g @yank_selection_mouse 'clipboard' # or 'primary' or 'secondary'
##########################
##########################
# tmux-resurrect
# https://github.com/tmux-plugins/tmux-resurrect
set -g @plugin 'tmux-plugins/tmux-resurrect'
# restore vim sessions - requires the tpope/vim-obsession vim plugin
# https://github.com/tmux-plugins/tmux-resurrect/blob/master/docs/restoring_vim_and_neovim_sessions.md
set -g @resurrect-strategy-vim 'session'
##########################
##########################
# tmux-continuum
# https://github.com/tmux-plugins/tmux-continuum
# Automatically save and restore tmux sessions! It requires tmux-resurrect
# IMPORTANT: place this plugin *LAST* in the plugin list
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @continuum-restore 'on'
##########################
# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin 'github_username/plugin_name#branch'
# set -g @plugin 'git@github.com:user/plugin'
# set -g @plugin 'git@bitbucket.com:user/plugin'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'