-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
96 lines (72 loc) · 3.28 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
# disable the status bar
# set -g status off
set-window-option -g mode-keys vi
set-window-option -g set-clipboard on
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key P paste-buffer
bind r source-file ~/.tmux.conf
bind C-c display-popup -w 70% -h 3 -E 'IFS= read -p "Chat > " -r line; send-twitch-msg "$line"'
# Spotify controls
bind-key l run-shell "baton next > /dev/null"
bind-key h run-shell "baton prev > /dev/null"
bind-key j run-shell "baton status"
bind-key k run-shell "baton pause > /dev/null"
bind-key Enter run-shell "baton save > /dev/null"
set -g mouse on
set -g focus-events on
# transfer copied text to attached terminal with yank
bind-key -T copy-mode-vi Y send-keys -X copy-pipe 'yank > #{pane_tty}'
set-hook -g pane-set-clipboard "run-shell 'tmux save-buffer - | yank > #{pane_tty}'"
# transfer most-recently copied text to attached terminal with yank
bind-key -n M-y run-shell 'tmux save-buffer - | yank > #{pane_tty}'
# transfer previously copied text (chosen from a menu) to attached terminal
bind-key -n M-Y choose-buffer 'run-shell "tmux save-buffer -b \"%%%\" - | yank > #{pane_tty}"'
# Prevent tmux from starting a login shell
set-option -g default-command zsh
# make neovim + ST happy
# set -as terminal-overrides ',st*:Ss@'
# enable 256 color
set -g default-terminal "tmux-256color"
set -ga terminal-overrides ",xterm-256color*:Tc"
set -as terminal-overrides ',xterm*:sitm=\E[3m'
# set -g default-terminal 'tmux-256color'
# set -ga terminal-overrides ',*256col*:Tc'
# use ctr-b {h,v} to split horizontally and vertically, not ctrl-b {",%}
# also, open new splits and windows in the current directory, not the one tmux was launched from
unbind-key %
unbind-key '"'
bind-key c neww -c '#{pane_current_path}'
bind-key v split-window -h -c '#{pane_current_path}'
# collapse sessions by default
bind-key w choose-tree -s
# infinite scrollback
set-option -g history-limit 300000
# make vim happier
set-option -sg escape-time 10
# use vim-like keys for splits and windows
bind-key v split-window -h
bind-key s split-window -v
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim='ps -o state= -o comm= -t "#{pane_tty}" | grep -iqE "^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$"'
bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L'
bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D'
bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U'
bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R'
bind-key -T copy-mode-vi 'C-h' select-pane -L
bind-key -T copy-mode-vi 'C-j' select-pane -D
bind-key -T copy-mode-vi 'C-k' select-pane -U
bind-key -T copy-mode-vi 'C-l' select-pane -R
# Status bar
# set -g status-right '#(spotify-status-bar)'
run-shell "powerline-daemon -q"
set-option -g status-position top
if-shell 'env "$POWERLINE_CONFIG_COMMAND" tmux setup' '' 'run-shell "powerline-config tmux setup"'
# Save history to file
bind-key P command-prompt -p 'save history to filename:' -I '~/tmux.history' 'capture-pane -S -; save-buffer %1 ; delete-buffer'
# Upload history to termbin
bind-key I run-shell 'tmux capture-pane -pS - | owlbin'
# pane titles for hostname
# set -g pane-border-format " #T "
# set -g pane-border-status top
# setw -g automatic-rename off