This repository has been archived by the owner on Dec 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtmux.conf
95 lines (74 loc) · 3.73 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
93
94
95
# Replace C-b with C-a for the prefix key
unbind C-b
set -g prefix C-s
bind-key -r C-s send-prefix # for nested tmux sessions
set -g history-limit 1000000
# Easy reloading of the tmux.conf config file
bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded"
# Seamless aviation using vim-tmux-navigator (github christoomey/vim-tmux-navigator)
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?x?)(diff)?$"'
bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
bind -n 'C-\' if-shell "$is_vim" "send-keys 'C-\\'" "select-pane -l"
# Use 256 color mode, useful for Vim
set-option -g default-terminal "screen-256color" #"xterm-256color" # "screen-256color"
# Use emacs / readline key-bindings in the tmux command prompt
set-option -g status-keys "emacs"
# More intuitive pane splitting key-bindings, open all in current path
bind-key - split-window -v # split pane horizontally
bind-key '\' split-window -h # split pane vertically
bind c new-window
# Easy resizing of panes with fine and coarse adjustment
bind -n S-Left resize-pane -L 2
bind -n S-Right resize-pane -R 2
bind -n S-Down resize-pane -D 1
bind -n S-Up resize-pane -U 1
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
# Start the window numbering at 1, renumber as created/destroyed
set-option -g base-index 1
set-option -g renumber-windows on
bind-key b break-pane -d
# Use vim keybindings when copying
setw -g mode-keys vi
# Setup 'v' to begin selection as in Vim
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xsel -i -p && xsel -o -p | xsel -i -b"
# Update default binding of `Enter` to also use copy-pipe
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xsel -i -p && xsel -o -p | xsel -i -b"
# Fuzzy matching session navigation via fzf utility
bind C-j split-window -v "tmux list-sessions | sed -E 's/:.*$//' | grep -v \"^$(tmux display-message -p '#S')\$\" | fzf --reverse | xargs tmux switch-client -t"
# Prompted join-pane
bind-key j command-prompt -p "join pane from:" "join-pane -h -s '%%'"
# Easily swap a pane (targeted by pane number) with the current pane
bind-key s display-panes\; command-prompt -p "pane #: " "swap-pane -t '%%'"
# "break session" and "kill session" without exiting tmux
bind-key C-b send-keys "tat" "C-m"
bind-key K run-shell 'tmux switch-client -n \; kill-session -t "$(tmux display-message -p "#S")" || tmux kill-session'
############################################################################
# Status Bar
############################################################################
set-option -g status-justify right
set-option -g status-bg black # colour213 # pink
set-option -g status-fg cyan
set-option -g status-interval 5
set-option -g status-left-length 25
set-option -g status-left "#[fg=cyan,bold]#S#[fg=color244]@#[fg=cyan,bold]#H #(battery -pt)"
set-option -g status-right "#[fg=red,bold] %H:%M #[fg=cyan]» #[fg=blue,bold]%a %e %b %Y#[default]"
set-option -g window-status-format "#[fg=green]#W"
set-option -g window-status-current-format "#[bg=black, fg=green, bold, underscore] #W "
set-option -g visual-activity on
# Titles (window number, program name, active (or not)
set-option -g set-titles on
set-option -g set-titles-string '#H:#S.#I.#P #W #T'
# use mouse for scrolling
setw -g mouse on
set -g update-environment -r
set-option -sg escape-time 10
set -ga terminal-overrides ",xterm-256color:Tc"
bind-key h split-window -h "htop"