-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtmux.conf
138 lines (107 loc) · 3.87 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# Thanks to
# sastrato - https://github.com/sstrato
# junegunn - https://github.com/junegunn
# Hierarchy:
# Server
# +- Session
# +- Window
# +- Pane
# Options:
# - Session options (set [-g])
# - Window options (setw [-g])
# - Bind key (bind)
# -----------------------------------------------------------------------------
# Seesion options
# -----------------------------------------------------------------------------
# Change bind key to ctrl-a
#unbind-key c-b
#set -g prefix c-a
# Index starts from 1
set -g base-index 1
# Renumber windws a window is closed
set -g renumber-windows on
# History
set -g history-limit 102400
# Repeat time limit (ms)
set -g repeat-time 500
# 256-color terminal
set -g default-terminal "screen-256color"
# Key binding in the status line (bind-key :)
set -g status-keys emacs
# Mouse
set -g mouse on
# Mouse (< V2.0)
#setw -g mode-mouse on
#set -g mouse-select-window on
#set -g mouse-select-pane on
#set -g mouse-resize-pane on
#set -g mouse-utf on
# -----------------------------------------------------------------------------
# Window options
# -----------------------------------------------------------------------------
# Copy-mode
setw -g mode-keys vi
# -----------------------------------------------------------------------------
# Key bindings
# -----------------------------------------------------------------------------
# prefix c
bind c new-window -c "#{pane_current_path}"
# ctrl-a ctrl-a
bind c-a last-window
# ctrl-a a
bind a send-prefix
# ctrl-a |
bind | split-window -h -c "#{pane_current_path}"
# ctrl-a -
bind - split-window -c "#{pane_current_path}"
# Moving windows
bind -r > swap-window -t :+
bind -r < swap-window -t :-
# Back and forth
bind bspace previous-window
bind space next-window
bind / next-layout # Overridden
# Pane-movement
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind tab select-pane -t :.+
bind btab select-pane -t :.-
# Synchronize panes
bind * setw synchronize-pane
# Reload ~/.tmux.conf
bind R source-file ~/.tmux.conf \; display-message "Reloaded!"
# copy-mode
#bind -t vi-copy 'v' begin-selection
#bind -t vi-copy 'y' copy-pipe "pbcopy"
# Capture pane and open in Vim
bind C-c run 'tmux capture-pane -S -102400 -p > /tmp/tmux-capture.txt'\;\
new-window "view /tmp/tmux-capture.txt"
bind M-c run "screencapture -l$(osascript -e 'tell app \"iTerm2\" to id of window 1') -x -o -P /tmp/$(date +%Y%m%d-%H%M%S).png"
# Resizing pane
bind -r K resize-pane -U 5
bind -r J resize-pane -D 5
bind -r H resize-pane -L 5
bind -r L resize-pane -R 5
# -----------------------------------------------------------------------------
# Decoration (256-color)
# -----------------------------------------------------------------------------
set -g status-justify "left"
set -g status-left "#($HOME/dotrc/tmux-powerline/powerline.sh left)"
set -g status-left-length 100
set -g status-bg colour237
set -g status-right "#($HOME/dotrc/tmux-powerline/powerline.sh right)"
set -g status-right-length 100
set -g status-interval 60
set -g pane-active-border-fg colour240
set -g pane-border-fg colour238
setw -g window-status-format '#[bg-colour238]#[fg=colour107] #I #[bg=colour239]#[fg=colour110] #[bg=colour240]#W#[bg=colour239]#[fg=colour195]#F#[bg=colour238] '
setw -g window-status-current-format '#[bg=colour236]#[fg=colour215] #I #[bg=colour235]#[fg=colour167] #[bg=colour234]#W#[bg=colour235] #[fg=colour195]#F#[bg=colour236] '
# -----------------------------------------------------------------------------
# fzf integration
# -----------------------------------------------------------------------------
# Tmux completion
#bind -n 'M-t' run "tmux split-window -p 40 'tmux send-keys -t #{pane_id} \"$(tmuxwords.rb --all --scroll 1000 --min 5 | fzf --multi | paste -sd\\ -)\"'"
# fzf-locate
#bind -n 'M-l' fun "tmux split-window -p 40 'tmux send-keys -t #{pane_id} \"$(locate / | fzf -m | paste -sd\\ -)\"'"