-
Notifications
You must be signed in to change notification settings - Fork 2
/
.tmux.conf
82 lines (67 loc) · 2.61 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
#################### TMUX CONF ####################
# {{{ Unbind first
unbind-key C-b #no more C^b
unbind-key [
# }}}
# {{{ Options
set -g base-index 1
setw -g pane-base-index 1
#set-option -g default-terminal "xterm-256color"
set -g default-terminal "screen"
set-option -g default-shell /mnt/sw/nix/state/profiles/x86_64/rocky8/shell/bin/zsh
set -g default-command /mnt/sw/nix/state/profiles/x86_64/rocky8/shell/bin/zsh # Avoid login-shells
set-option -g history-limit 50000
# -- vi mode
setw -g mode-keys vi
set -g status-keys vi
set -g repeat-time 1000
#set -g status-utf8 on
set -sg escape-time 0
# }}}
# {{{ prefix
# Semicolon is the only key that isn't bound by readline
# this creates a problem inside of ttys...
set-option -g prefix C-f
bind-key f send-prefix
# }}}
# Key bindings {{{
bind-key r source-file ~/.tmux.conf \; display-message "source-file done"
# All sorts of Vi-type bindings
# https://github.com/justone/dotfiles/blob/personal/.tmux.shared#L3
# VI for switching between
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
bind-key s splitw -v
bind-key v splitw -h
bind-key S choose-session
# keybindings to make resizing easier
bind-key -r C-h resize-pane -L
bind-key -r C-j resize-pane -D
bind-key -r C-k resize-pane -U
bind-key -r C-l resize-pane -R
bind-key | resize-pane -Z \; display-message "Zoom zoom zoom"
# Pane movement
bind-key J command-prompt -p "join pane from:" "join-pane -s '%%'"
bind-key B command-prompt -p "break pane to:" "break-pane -t '%%'"
bind-key M-k move-pane -t ':+'
bind-key M-j move-pane -t ':-'
# Vi copy and paste in tmux
# http://joncairns.com/2013/06/copying-between-tmux-buffers-and-the-system-clipboard/
# http://www.rushiagr.com/blog/2016/06/16/everything-you-need-to-know-about-tmux-copy-pasting-ubuntu/
#bind-key Escape copy-mode
bind-key [ copy-mode
bind-key -T copy-mode-vi 'v' send -X begin-selection
#bind-key -T copy-mode-vi 'y' send -X copy-selection
#bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel 'xclip -in'
bind-key -T copy-mode-vi 'r' send -X rectangle-toggle
bind-key 'P' paste-buffer
#}}}
# only if this is the first level of inception do that fancy status bar
# Allow mouse copy
# set -g mouse on
# System Specific {{{
if-shell 'test "$(uname -s)" = "Darwin"' 'bind-key y run-shell "tmux show-buffer | pbcopy" \; display-message "Copied tmux buffer to system clipboard"'
if-shell 'test "$(uname -s)" = "Linux"' 'bind-key y run-shell "tmux show-buffer | xsel -pi" \; display-message "Copied tmux buffer to system clipboard"'