-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.tmux.conf
84 lines (66 loc) · 2.55 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
set -g default-command /usr/local/bin/zsh
# setting mouse usage
# setw -g mode-mouse on
# set -g mouse-select-pane on
# set -g mouse-resize-pane on
# set -g mouse-select-window on
set -g default-terminal "xterm"
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
# -----Mac OSX specific settings --------------------------------
# for neovim
set escape-time 0
# clipboard settings
set-option -g default-command "reattach-to-user-namespace -l zsh"
setw -g mode-keys vi
# Setup 'v' to begin selection as in Vim
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-pipe "reattach-to-user-namespace pbcopy"
# Update default binding of `Enter` to also use copy-pipe
# unbind -t vi-copy Enter
# bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
# Bind ']' to use pbpaste
bind ] run "reattach-to-user-namespace pbpaste | tmux load-buffer - && tmux paste-buffer"
# -----end of Mac OSX specific settings --------------------------------
# allow vi-keyboard bindings to work
set-window-option -g mode-keys vi
set -g default-terminal "screen-256color"
# save tmux session plugin
run-shell ~/Software/tmux-resurrect/resurrect.tmux
## keyboard shortcut
# Ctrl-B Ctrl-s save session
# Ctrl-B Ctrl-r restore session
# want the status position to be on top
set-option -g status-position top
# set the prefix to
# set prefix C-q
# unbind-key C-b
# bind-key C-q send-prefix
# set window list colors
# set-window-option -g window-status-current-bg colour202
# set-window-option -g window-status-current-fg colour208
# set tmux status line
set -g status-bg colour172
set -g status-fg colour221
#set-window-option -g window-status-current-attr bright
# Smart pane switching with awareness of vim splits
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?)(diff)?$"'
bind -n C-Left if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind -n C-Down if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind -n C-Up if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind -n C-Right if-shell "$is_vim" "send-keys C-l" "select-pane -R"
bind -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
# Navigate panes like Vim.
bind -r C-Left select-pane -L
bind -r C-Down select-pane -D
bind -r C-Up select-pane -U
bind -r C-Right select-pane -R
# # Split windows like Vim.
bind v split-window -h
bind s split-window -v
# make Tmux copy-and-paste shortcut to be vim-like
unbind [
bind Escape copy-mode
unbind p
bind p paste-buffer