-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
110 lines (92 loc) · 3.86 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
# use C-a, since it's on the home row and easier to hit than C-b
set-option -g prefix C-a
unbind-key C-a
bind-key C-a send-prefix
set -g base-index 1
# Easy config reload
bind-key R source-file ~/.tmux.conf \; display-message "tmux.conf reloaded."
# edit tmux.conf or tmux-status
bind E new-window -n 'tmux.conf' 'nvim ~/.dotfiles/tmux.conf && tmux source ~/.tmux.conf && tmux display "~/.tmux.conf sourced"'
bind S new-window -n 'tmux-status.conf' 'nvim ~/.config/tmux-status.conf && tmux source ~/.tmux.conf && tmux display "~/.tmux.conf sourced"'
# edit vimrc
bind V new-window -n 'vimrc' 'nvim ~/.dotfiles/vimrc'
bind N new-window -n 'nimrc' 'nvim ~/.dotfiles/config/nvim/init.vim'
# vi is good
setw -g mode-keys vi
set -g status-keys vi
bind-key -t vi-copy 'v' begin-selection
bind-key -t vi-copy 'y' copy-selection
set -g default-terminal "xterm-256color-italic"
set-option -ga terminal-overrides ',xterm-256color-italic:Tc'
#
set -sg escape-time 0
# mouse behavior
set-option -g -q mouse on
# set -g mouse-select-pane on
# set -g mouse-resize-pane on
bind-key : command-prompt
bind-key r refresh-client
bind-key L clear-history
bind-key Q set -g status
bind-key space next-window
bind-key bspace previous-window
bind-key enter next-layout
# use vim-like keys for splits and windows
bind-key v split-window -h -c "#{pane_current_path}"
bind-key s split-window -v -c "#{pane_current_path}"
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
bind-key P display-message "clearing memory"\; run "sudo purge"
# smart pane switching with awareness of vim splits
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?)(diff)?$"'
bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
bind -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
bind C-l send-keys 'C-l'
bind-key C-o rotate-window
bind-key + select-layout main-horizontal
bind-key = select-layout main-vertical
set-window-option -g other-pane-height 10
set-window-option -g other-pane-width 90
bind-key a last-pane
bind-key q display-panes
bind-key c new-window -c "#{pane_current_path}"
bind-key t next-window
bind-key T previous-window
bind-key [ copy-mode
bind-key ] paste-buffer
# Setup 'v' to begin selection as in Vim
bind-key -t vi-copy v begin-selection
bind-key -t vi-copy y 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"
set-window-option -g display-panes-time 1500
# Enable native Mac OS X copy/paste
set-option -g default-command "/bin/bash -c 'which reattach-to-user-namespace >/dev/null && exec reattach-to-user-namespace $SHELL -l || exec $SHELL -l'"
# Allow the arrow key to be used immediately after changing windows
set-option -g repeat-time 0
#====== START THE STATUS BAR =============#
source-file $HOME/.config/tmux-status.conf
# List of plugins
set -g monitor-activity on
# Supports `github_username/repo` or full git repo URLs
set-environment -g TMUX_PLUGIN_MANAGER_PATH '$HOME/.tmux/tmux-plugins/'
set -g @tpm_plugins ' \
tmux-plugins/tpm \
tmux-plugins/tmux-battery \
tmux-plugins/tmux-cpu \
mhartington/tmux-mail \
tmux-plugins/tmux-resurrect \
'
# Other examples:
# github_username/plugin_name \
# [email protected]/user/plugin \
# [email protected]/user/plugin \
# Initializes TMUX plugin manager.
# Keep this line at the very bottom of tmux.conf.
run-shell $HOME/.tmux/tmux-plugins/tpm/tpm