-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
112 lines (86 loc) · 3.6 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
106
107
108
109
110
111
112
# Use vi keys for navigating panes
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Change prefix to c-a
unbind C-b
set -g prefix C-a
bind C-a send-prefix
# Toggle windows
bind-key C-a last-window
# Jump to beginning of line in Bash
bind a send-prefix
# Longer pane timeout
set display-panes-time 2000
# Vi keys (in copy mode)
set-window-option -g mode-keys vi
# Increase buffer
set-option -g history-limit 10000
# Set history file
set -g history-file ~/.tmux_history
# Active pane colors:
set -g window-style 'fg=colour247,bg=colour232'
set -g window-active-style 'bg=black'
# Remove delay when escaping in vim:
set -sg escape-time 10
# Turn on mouse support
set -g mouse on
# Clipboard integration on mac
bind -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "pbcopy"
# Set TERM (enable if colour issues)
# https://github.com/tmux/tmux/wiki/FAQ#how-do-i-use-a-256-colour-terminal
# set -g default-terminal "tmux-256color"
### Extra settings ###
# TODO: Delete or move these to a backup/archive if not used
# Bind prefix to both c-a & c-b
# unbind C-b
# set-option -g prefix C-a
# bind C-a send-prefix
# set-option -g prefix2 C-b
# Toggle windows
# bind-key C-a last-window
# bind-key C-b last-window
# Integration with mac
# https://robots.thoughtbot.com/how-to-copy-and-paste-with-tmux-on-mac-os-x
# set-option -g default-command "reattach-to-user-namespace -l zsh"
# test nested config - http://stahlke.org/dan/tmux-nested/
# set -g status-bg colour40
# setw -g window-status-current-bg colour40
# bind -n M-F11 set -qg status-bg colour25
# bind -n M-F12 set -qg status-bg colour40
# bind -n C-up \
# send-keys M-F12 \; \
# set -qg status-bg colour25 \; \
# unbind -n S-left \; \
# unbind -n S-right \; \
# unbind -n S-C-left \; \
# unbind -n S-C-right \; \
# unbind -n C-t \; \
# set -qg prefix C-b
# bind -n C-down \
# send-keys M-F11 \; \
# set -qg status-bg colour40 \; \
# bind -n S-left prev \; \
# bind -n S-right next \; \
# bind -n S-C-left swap-window -t -1 \; \
# bind -n S-C-right swap-window -t +1 \; \
# bind -n C-t new-window -a -c "#{pane_current_path}" \; \
# set -qg prefix C-a
# Clipboard integration with Linux (requires tmux 2.5+)
# bind -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xclip -i -f -selection primary | xclip -i -selection clipboard"
# Remote copy paste on mac
# Add to .ssh/config on local machine:
# Host *
# RemoteForward 2224 127.0.0.1:2224
# create '~/Library/LaunchAgents/pbcopy.plist' on local machine:
# <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>localhost.pbcopy</string> <key>ProgramArguments</key> <array> <string>/usr/bin/pbcopy</string> </array> <key>inetdCompatibility</key> <dict> <key>Wait</key> <false/> </dict> <key>Sockets</key> <dict> <key>Listeners</key> <dict> <key>SockServiceName</key> <string>2224</string> <key>SockNodeName</key> <string>127.0.0.1</string> </dict> </dict> </dict> </plist>
# Run: launchctl load ~/Library/LaunchAgents/pbcopy.plist
# Create script on remote machine '~/.remote_pb_copy.sh'
#!/usr/bin/env sh
#cat | nc -q1 localhost 2224
# On remote machine:
# bind -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "~/.remote_pb_copy.sh"
# If local machine is running Linux, run start_xclipper (see .bash_aliases)
# Toggle mouse mode with +
# bind + set-option mouse\; display-message "Mouse is now #{?mouse,on,off}"