-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
105 lines (80 loc) · 2.81 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
96
97
98
99
100
101
102
103
104
105
# Set XTerm key bindings
setw -g xterm-keys on
# Change default ^b
set -g prefix M-s
unbind C-b
bind M-s send-prefix
unbind C-c
# Set colors
set-option -g default-terminal "screen-256color"
# Set reload key to r
bind r source-file ~/.tmux.conf
# Count sessions start at 1
set -g base-index 1
# tmux + vim + esc too slow with default conf
set -s escape-time 0
################################################################################
# Vim keybindings
################################################################################
# Use vim bindings
setw -g mode-keys vi
# Remap window navigation to vim
unbind-key j
bind-key j select-pane -D
unbind-key k
bind-key k select-pane -U
unbind-key h
bind-key h select-pane -L
unbind-key l
bind-key l select-pane -R
################################################################################
# Status bar
################################################################################
set -g status-position top
set -g status-bg black
set -g status-fg white
set -g status-interval 5
set -g status-left-length 90
set -g status-right-length 60
set -g status-left "#[fg=Green]#(whoami)#[fg=white]::#[fg=cyan]#(hostname -s)#[fg=white]::#[fg=yellow]"
set -g status-justify left
set -g status-right '#[fg=Cyan]#S #[fg=white]%a %d %b %R'
set -g visual-activity on
# Set the title bar
set -g set-titles on
set -g set-titles-string '#(whoami) : #h'
# Resize windows based on smallest client viewing it
# instead of the smallest attached to entire session
setw -g aggressive-resize on
# scrollback limit
set -g history-limit 10000
# highlight current window
set-window-option -g window-status-current-bg colour240
################################################################################
# Copy and paste:
# https://robots.thoughtbot.com/tmux-copy-paste-on-os-x-a-better-future
################################################################################
# set '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 "reattach-to-user-namespace pbcopy"
bind-key space next-window
bind-key M-space previous-window
################################################################################
# Enable mouse
################################################################################
set -g mouse on
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
# Resizing ---------------------------------------------------------------
bind-key C-h resize-pane -L 4
bind-key C-j resize-pane -D 4
bind-key C-k resize-pane -U 4
bind-key C-l resize-pane -R 4
bind-key C-w select-layout "even-horizontal"
### To get the list of colors for tmux:
##!/usr/bin/env bash
# for i in {0..255} ; do
# printf "\x1b[38;5;${i}mcolour${i}\n"
# done
# Kept for posterity
# quick pane cycling
# bind-key -n C-space select-pane -t :.+