-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
89 lines (68 loc) · 2.74 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
set -g default-terminal 'tmux-256color'
set -as terminal-overrides ',xterm*:Tc:sitm=\E[3m'
set -g history-limit 100000
# Shortcut to reloading the tmux config
unbind r
bind r source-file $HOME/.tmux.conf \; display "Reloaded ~/.tmux.conf"
# Remap the prefix key from `<Ctrl-b>` to `<Ctrl-Space>`
unbind C-b
set -g prefix C-Space
# Disable the mouse
set -g mouse off
# Unbind the defaults for horizontal and vertical window splitting
unbind '%'
unbind '"'
# Create custom bindings for horizontal and vertical window splitting
unbind v
unbind h
bind h split-window -h -c "#{pane_current_path}"
bind v split-window -v -c "#{pane_current_path}"
# Unbind the defaults for moving and renaming windows
unbind n
unbind w
# Create custom bindings for moving and renaming windows
bind n command-prompt "rename-window '%%'" # Rename the current window
bind w new-window -c "#{pane_current_path}" # Create a new window
bind -n M-j previous-window # <Alt-j> moves to the previous window
bind -n M-k next-window # <Alt-k> moves to the next window
# Unbind the defaults for copy/paste mode
unbind '['
unbind ']'
# Create custom bindings for copy/paste mode
bind p paste-buffer
bind j copy-mode
# When in copy mode, use Vi-like bindings
set-window-option -g mode-keys vi
# Unbind the defaults for selecting and copying text
unbind -T copy-mode-vi Space;
unbind -T copy-mode-vi Enter;
# By default, tmux does not copy anything to the system clipboard
# This forces tmux to use the system clipboard each time something is copied
# `v` is used to select text and `y` is used to copy text
bind -T copy-mode-vi v send-keys -X begin-selection
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xclip -i -f -selection primary | xclip -i -selection clipboard"
# If run as 'tmux attach', create a session if one does not exist already
new-session -n $HOST
# Begin window numbers with '1' instead of '0'
set -g base-index 1
set-window-option -g pane-base-index 1
bind > swap-pane -D # Swap current pane with the next pane
bind < swap-pane -U # Swap current pane with the previous pane
# tmux colors
#
# Pane border
set-option -g pane-border-style fg=black
set-option -g pane-active-border-style fg=green
# Status Bar Customization
set -g status-justify left
set -g status-style fg=cyan
set -g status-interval 2
# Install tpm if it is not installed already
if "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
# Plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'tmux-plugins/tmux-sensible'
# Initialize tmux plugin manager (keep this line at the very bottom of .tmux.conf)
run -b '$HOME/.tmux/plugins/tpm/tpm'