-
Notifications
You must be signed in to change notification settings - Fork 1
/
tmux.conf
104 lines (89 loc) · 3.52 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
## # use ^E as prefix block START
## set-option -g prefix C-e
## bind-key C-e last-window
## bind-key e send-prefix
## # use ^E as prefix block END
## # use ^A as prefix block START
## set-option -g prefix C-a
## bind-key C-a last-window
## bind-key a send-prefix
## # use ^A as prefix block END
# use ^@ as prefix block START
# ^@ is also C-space
set-option -g prefix C-@
bind-key C-@ last-window
bind-key x send-prefix
# use ^@ as prefix block END
# OSspecific items (in seperate files) per
# https://superuser.com/questions/539595/tmux-configuration-conditional-to-os#539657
if-shell "uname | grep -w Darwin" "source-file .tmux.conf.Darwin"
set-option -g main-pane-width 81
# vim-keys.conf START
# $Id: vim-keys.conf,v 1.2 2010-09-18 09:36:15 nicm Exp $
#
# vim-keys.conf, v1.2 2010/09/12
#
# By Daniel Thau. Public domain.
#
# This configuration file binds many vi- and vim-like bindings to the
# appropriate tmux key bindings. Note that for many key bindings there is no
# tmux analogue. This is intended for tmux 1.3, which handles pane selection
# differently from the previous versions
# split windows like vim
# vim's definition of a horizontal/vertical split is reversed from tmux's
###bind s split-window -v
###bind v split-window -h
# move around panes with hjkl, as one would in vim after pressing ctrl-w
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# resize panes like vim
# feel free to change the "1" to however many lines you want to resize by, only
# one at a time can be slow
bind < resize-pane -L 1
bind > resize-pane -R 1
bind - resize-pane -D 1
bind + resize-pane -U 1
# bind : to command-prompt like vim
# this is the default in tmux already
bind : command-prompt
# vi-style controls for copy mode
setw -g mode-keys vi
# vim-keys.conf END
#
# from http://stackoverflow.com/questions/10158508/lose-vim-colorscheme-in-tmux-mode
# to deal with colors & tmux & iterm & vim
# xterm-256color to get solarized to work in vim
set -g default-terminal "xterm-256color"
# but for neovim, we need
# per https://github.com/neovim/neovim/wiki/FAQ#colors-arent-displayed-correctly
# set -g default-terminal "screen-256color-bce"
# tmux plugin integration
if "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'tmux-plugins/tmux-yank'
# from https://grota.github.io/blog/2012/05/08/tmux-clipboard-integration/
# C-c: save into system clipboard (+). With preselection.
bind C-c choose-buffer "run \"tmux save-buffer -b %% - | xclip -i -sel clipboard\" "
# C-v: copy from + clipboard.
bind C-v run "tmux set-buffer \"$(xclip -o -sel clipboard)\"\; tmux paste-buffer"
# C-d: save into selection clipboard (*). With preselection.
bind C-d choose-buffer "run \"tmux save-buffer -b %% - | xclip -i\" "
# C-f: copy from * clipboard.
bind C-f run "tmux set-buffer \"$(xclip -o)\"\; tmux paste-buffer"
# See for more links:
# https://github.com/tmux-plugins
# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin '[email protected]/user/plugin'
# set -g @plugin '[email protected]/user/plugin'
# Ubuntu (wsl) special
# C-c: save into system clipboard (+). With preselection.
bind C-c choose-buffer "run \"tmux save-buffer -b %% - | clip.exe\""
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'