-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.tmux.conf
86 lines (67 loc) · 2.89 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
# Make it use C-l, similar to how I use screen
unbind C-b
unbind l
set -g prefix C-l
bind-key C-l last-window
# Reload key
bind r source-file ~/.tmux.conf
set -g default-terminal "screen-256color"
set -g history-limit 9999999
# history navigation like vim
set-window-option -g mode-keys vi
# Set status bar
set -g status-bg black
set -g status-fg white
# set -g status-left '#[fg=green]#H'
# Highlight active window
# stopped working in 2.9
#set-window-option -g window-status-current-bg red
set-window-option -g window-status-current-style bg=red
# Use the mouse
#set-option -g mouse-select-pane on
# use "v" and "s" to do vertical/horizontal splits, like vim
bind s split-window -v -c "#{pane_current_path}"
bind v split-window -h -c "#{pane_current_path}"
# tmux 1.9 broke keeping cwd on split, need -c option
bind c new-window -c "#{pane_current_path}"
# use the vim motion keys to move between panes
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# use the vim resize keys.
bind -r < resize-pane -L 5
bind -r > resize-pane -R 5
# resize up and down too
unbind S-Left
unbind S-Right
unbind S-Down
unbind S-Up
bind -r S-Left resize-pane -L 5
bind -r S-Right resize-pane -R 5
bind -r S-Up resize-pane -U 5
bind -r S-Down resize-pane -D 5
# probably won't use this since I don't use multiple sessions
bind S choose-session
# window rename like screen
bind A command-prompt "rename-window '%%'"
# Join the first pane from window x
bind J command-prompt "join-pane -s '%%'.0"
bind @ break-pane -d
# Fix pbcopy and pbpaste.
# See: https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard
if-shell 'test "$(uname)" = "Darwin"' 'set-option -g default-command "[ -e $(which reattach-to-user-namespace) ] && reattach-to-user-namespace -l zsh || exec zsh"'
# http://unix.stackexchange.com/questions/15715/getting-tmux-to-copy-a-buffer-to-the-clipboard
# bind - run-shell "tmux show-buffer | xclip -selection clipboard"
# bind + run-shell "tmux set-buffer \"$(xclip -selection clipboard -o')\"; tmux paste-buffer"
bind - run "tmux save-buffer - | reattach-to-user-namespace pbcopy"
bind + run "reattach-to-user-namespace pbpaste | tmux load-buffer - && tmux paste-buffer"
# Could not open a connection to your authentication agent. in wemux - not sure why
# This doens't help either :(
# set -g update-environment "SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION"
# bind-key H pipe-pane -o "exec cat >>$HOME/'#W-tmux.log'" \; display-message 'Toggled logging to $HOME/#W-tmux.log'
#bind-key H pipe-pane -o 'exec bash -c "while IFS= read -r line; do echo \"\$(date +%%Y%%m%%dT%%H%%M%%SZ%%z): \$line\"; done" >>$HOME/"#W-tmux.log"'
# otherwise ctrl + [ goes really slow in neovim
set -s escape-time 0
# clipper to send copy from remote host to localhost running clipper with ssh remoteforward
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "socat - UNIX-CLIENT:$HOME/.clipper.sock"