-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
92 lines (71 loc) · 2.9 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
# Credits to Ham Vocke and thoughtbot for all the help provided
# https://www.hamvocke.com/blog/a-guide-to-customizing-your-tmux-conf/
# https://thoughtbot.com/upcase/tmux
# set Control-s as the prefix for tmux commands
unbind C-b
set -g prefix C-s
# Reload configuration on the fly
bind r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded"
# split panes using ' and - and interpolate the current path
unbind '"'
unbind %
bind "'" split-window -h -c '#{pane_current_path}'
bind - split-window -v -c '#{pane_current_path}'
# Create new window while keeping the current path of the active pane
bind c new-window -c '#{pane_current_path}'
# "Break" pane and send to new window in "detach" (-d) mode to keep the current pane active
bind b break-pane -d
# Choose which window to open from available sessions in a tree-like presentation
bind C-j choose-tree
# Open Vimwiki in new window
bind w new-window -c ~/Dropbox/notes "nvim index.wiki"
# Same as prefix + 'n' and prefix + 'p' but faster if there's a need to swap windows
bind C-Left previous-window
bind C-Right next-window
bind C-p previous-window
bind C-n next-window
# Swap windows left/right from current position, cycling at the ends
bind -n M-Left swap-window -t -1\; select-window -t -1
bind -n M-Right swap-window -t +1\; select-window -t +1
# Use vim keybindings in copy mode
setw -g mode-keys vi
set-option -s set-clipboard off
bind P paste-buffer
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X rectangle-toggle
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel 'xclip -se c -i'
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel 'xclip -se c -i'
# Switch panes using Alt-[HJKL] without prefix (uppercase letters)
bind -n M-H select-pane -L
bind -n M-L select-pane -R
bind -n M-K select-pane -U
bind -n M-J select-pane -D
# Start numbering windows at index 1 and renumber them when they are destroyed
set -g base-index 1
set -g renumber-windows on
# Resize panes
bind -n S-Left resize-pane -L 2
bind -n S-Right resize-pane -R 2
bind -n S-Down resize-pane -D 2
bind -n S-Up resize-pane -U 2
bind -n C-Left resize-pane -L 10
bind -n C-Right resize-pane -R 10
bind -n C-Down resize-pane -D 5
bind -n C-Up resize-pane -U 5
# Enable mouse mode (tmux 2.1 and above)
set -g mouse on
# Fix weird colors in Neovim
set -ga terminal-overrides ",*256col*:Tc"
# Fix warning about wrong colors in Neovim
set-option -g default-terminal "screen-256color"
# Emacs emulation (e.g. when running commands) similar to Bash key bindings
set -g status-keys "emacs"
set -sg escape-time 10
# Customize the status line
set -g status-fg green
set -g status-bg black
# Display up to 50 characters for the name of the session
set -g status-left-length 50
# Set the date in the bottom-right corner, i.e. Sun, Dec 20 2020 - 19:46
set -g status-right "#(date '+%a, %b %d %Y - %H:%M')"