-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtmux.conf
More file actions
143 lines (108 loc) · 4.64 KB
/
Copy pathtmux.conf
File metadata and controls
143 lines (108 loc) · 4.64 KB
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
set -g default-terminal "tmux-256color"
set -ag terminal-overrides ",xterm-256color:RGB"
if-shell '[ "$(uname)" = "Linux" ]' \
"set-environment -g 'SSH_AUTH_SOCK' ~/.ssh/ssh_auth_sock"
# set ` (tic) as the default prefix key combination
# and unbind C-b to free it up
unbind C-b
set -g prefix `
# use send-prefix to pass ` (tic) through to application
bind ` send-prefix
bind r source-file ~/.tmux.conf \; display "Config reloaded!"
# set window and pane index to 1 (0 by default)
set-option -g base-index 1
setw -g pane-base-index 1
# Force tmux switch to next open session
set-option -g detach-on-destroy off
set -g allow-passthrough on
# Reload current pane
# bind r respawn-pane -k -c "#{pane_current_path}"
# use PREFIX | to split window horizontally and PREFIX - to split vertically
bind | split-window -h
bind - split-window -v
# map Vi movement keys as pane movement keys
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Sync panes
bind C-s set-window-option synchronize-panes
# mouse control
set -g mouse on
# ----------------------
# Clipboard
# ----------------------
set -s set-clipboard on
# 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-selection-and-cancel
# update default binding of 'Enter' to also use copy-pipe
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi Enter send -X copy-selection-and-cancel
# enable mouse copy on drag
# bind-key -T copy-mode-vi MouseDragEnd1Pane
# ----------------------
# set some pretty colors
# ----------------------
set-option -g pane-border-style fg=colour250 #base02
set-option -g pane-active-border-style fg=colour33 #blue
# colorize messages in the command line
set-option -g message-style fg=brightred,bg=black
# ----------------------
# Status Bar
# -----------------------
set-option -g status on # turn the status bar on
set -g status-interval 5 # set update frequency (default 15
set -g status-justify centre # center window list for clarity
set-option -g status-position bottom # position the status bar at bottom of screen
# visual notification of activity in other windows
setw -g monitor-activity on
set -g visual-activity on
# set color for status bar
set-option -g status-style fg=yellow,bg=default
# set window list colors - red for active and cyan for inactive
set-window-option -g window-status-style fg="#666666",bg=default,dim
set-window-option -g window-status-current-style fg=brightred,bg=default,bright
# Show host, load averages, and an indicator for the prefix key
set -g status-left-length 60
set -g status-left "#[fg=green]: #h"
# executable and pathname
set -g window-status-format '#I❯#{b:pane_current_path} '
set -g window-status-current-format '#[fg=blue]#I❯#[fg=red]#{b:pane_current_path} '
# show session name, window & pane number, date and time on right side of status bar
set -g status-right-length 80
set -g status-right "#[fg=blue]#S #I:#P #[fg=yellow]: %d %b %Y #[fg=green]: %l:%M %p :"
# sesh
bind -N "last-session (via sesh)" L run-shell "sesh last"
bind-key C-p run-shell "sesh connect \"$(
sesh list --icons | fzf-tmux -p 80%,70% \
--no-sort --ansi --border-label ' sesh ' --prompt '⚡ ' \
--header ' ^a all ^t tmux ^g configs ^x zoxide ^d tmux kill ^f find' \
--bind 'tab:down,btab:up' \
--bind 'ctrl-a:change-prompt(⚡ )+reload(sesh list --icons)' \
--bind 'ctrl-t:change-prompt(🪟 )+reload(sesh list -t --icons)' \
--bind 'ctrl-g:change-prompt(⚙️ )+reload(sesh list -c --icons)' \
--bind 'ctrl-x:change-prompt(📁 )+reload(sesh list -z --icons)' \
--bind 'ctrl-f:change-prompt(🔎 )+reload(fd -H -d 2 -t d -E .Trash . ~)' \
--bind 'ctrl-d:execute(tmux kill-session -t {2..})+change-prompt(⚡ )+reload(sesh list --icons)' \
--preview-window 'right:55%' \
--preview 'sesh preview {}'
)\""
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'alberti42/tmux-fzf-links'
# Bootstrap tpm if needed
if "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
set -g @resurrect-capture-pane-contents 'on'
set -g @continuum-restore 'on'
set -g @continuum-boot 'on'
set-option -g @fzf-links-browser-open-cmd "open '%url'"
set-option -g @fzf-links-editor-open-cmd "tmux new-window -n 'nvim' nvim +%line '%file'"
# IMPORTANT!!! Keep this at the bottom
run '~/.tmux/plugins/tpm/tpm'