-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
83 lines (63 loc) · 3.05 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
# 256 colors for vim
set -g default-terminal "screen-256color"
#set -g default-terminal "xterm-256color"
# Start window numbering at 1
set-option -g base-index 1
set-window-option -g pane-base-index 1
# Cycle panes with C-b C-b
unbind ^B
bind ^B last-window
# Reload config with a key
bind-key r source-file ~/.tmux.conf \; display "Config reloaded!"
# Version-specific configuration can be placed in ~/.tmux/${TMUX_VERSION}/*.conf
run-shell "for conf in ~/.tmux/$(tmux -V | cut -d' ' -f2)/*.conf; do tmux source-file \"\$conf\"; done"
# Set ability to capture on start and restore on exit window data when running an application
setw -g alternate-screen on
# Scrolling works as expected
set -g terminal-overrides 'xterm*:smcup@:rmcup@:screen*'
# Revert to Pre 1.9a split pane current working
# directory behavior
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
# Clear the pane and it's history
#bind -n C-k send-keys C-l \; clear-history
# smart pane switching with awareness of vim splits
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-h) || tmux select-pane -L"
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-j) || tmux select-pane -D"
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-k) || (tmux display-message -p '#{pane_current_command}' | grep -iq ssh && tmux send-keys C-k) || tmux select-pane -U"
bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-l) || tmux select-pane -R"
bind -n C-\ run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys 'C-\\') || tmux select-pane -l"
# Move around panes vim style
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# clear screen
bind C-c send-keys 'C-l'
# Use vim keybindings in copy mode
setw -g mode-keys vi
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
#set -g @plugin 'tmux-plugins/tmux-sidebar'
# ukladani tmux session ctrl-b + ctrl-s
# obnovovani tmux session ctrl-b + ctrl-r
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
#set -g @resurrect-save-command-strategy 'pgrep'
#set -g @resurrect-processes 'ssh, vim'
set -g @resurrect-default-processes 'false'
set -g @resurrect-processes 'false'
#zrusena specialni slozka pro tmux-resurrect
#set -g @resurrect-dir '~/.tmux-resurrect'
set -g @continuum-restore 'on'
#set -g @continuum-boot 'on'
set -g @continuum-boot 'off'
# automaticka instalace pluginu
if "test ! -f ~/.tmux/plugins/tpm/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
#run-shell ~/.tmux/plugins/tmux-resurrect/resurrect.tmux
# pokud neexistuje sessiona, vytvori novou, aby tmux attach nefailoval
new-session