-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
91 lines (69 loc) · 2.55 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
# change the prefix from 'C-b' to 'C-q'
# (remap capslock to CTRL for easy access)
unbind C-b
set-option -g prefix C-q
bind-key C-q send-prefix
# start with window 1 (instead of 0)
set -g base-index 1
# start with pane 1
set -g pane-base-index 1
# split panes using | and -
bind | split-window -h -c "#{pane_current_path}"
bind \\ split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
bind _ split-window -v -c "#{pane_current_path}"
unbind '"'
unbind %
# open new windows in same path
bind c new-window -c "#{pane_current_path}"
# Load tmux sessionizer
bind-key -r f run-shell "tmux neww tmux-sessionizer"
# reload config file
bind r source-file ~/.tmux.conf \; display "tmux reloaded"
# skip confirmation to kill a pane
bind-key x kill-pane
# Don't exit when session is destroyed
set-option -g detach-on-destroy off
# shorten command delay
set -sg escape-time 0
# mouse control (clickable windows, panes, resizable panes)
set -g mouse on
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e; send-keys -M'"
# Resize panes without prefix and arrow keys
bind -n M-Down resize-pane -D 10
bind -n M-Up resize-pane -U 10
bind -n M-Left resize-pane -L 10
bind -n M-Right resize-pane -R 10
# Use prefix + arrow keys to switch panes
bind Down select-pane -D
bind Up select-pane -U
bind Left select-pane -L
bind Right select-pane -R
# Use vim keybindings in copy mode
setw -g mode-keys vi
# Setup 'v' to begin selection as in Vim
bind-key -T copy-mode-vi v send -X begin-selection
bind-key -T copy-mode-vi y send -X copy-pipe "reattach-to-user-namespace pbcopy" \; display "Copied text to clipboard" \; send-keys -X cancel
# set default terminal mode to 256 colors
set -g default-terminal "screen-256color"
# fix pbcopy/pbpaste
set -g default-shell $SHELL
set -g default-command "reattach-to-user-namespace -l ${SHELL}"
# present a menu of URLs to open from the visible pane. sweet.
bind-key u capture-pane \;\
save-buffer /tmp/tmux-buffer \;\
split-window -l 10 "urlview /tmp/tmux-buffer"
###########################
# Display
###########################
set -g @plugin 'rose-pine/tmux'
set -g @rose_pine_variant 'moon' # Options are 'main', 'moon' or 'dawn'
###########################
# Plugins
###########################
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'