-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
58 lines (46 loc) · 2.02 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
# Make tmux support many colors and italic text
set -g default-terminal "xterm-256color"
# Must match value of $TERM when _outside_ tmux
set-option -ga terminal-overrides ",xterm-256color-italic:Tc"
# Enable mouse interactions with tmux for some stuff
set -g mouse on
# Make <C-Space> the tmux prefix instead of the pain-in-the-ass <C-b>
unbind C-b
set -g prefix C-Space
bind Space send-prefix
# Split panes with | and -
# New windows and splits should be in the same directory
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
# Next and prev window command should match with vim
unbind l
bind h previous-window
bind l next-window
# Load Tmuxline vim plugin effects
# if-shell "test -f ~/.tmuxline_snapshot" source-file ~/.tmuxline_snapshot
#
set-option -w -g mode-keys vi
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode 'y' send -X copy-pipe-and-cancel "pbcopy"
source-file ~/.tmuxline_snapshot
# Reload config file (change file location to your the tmux.conf you want to
# use)
bind r source-file ~/.tmux.conf
# Don't automatically rename windows after naming them
set-option -g allow-rename off
# Make `open` work inside tmux
set-option -g default-command "reattach-to-user-namespace -l $SHELL"
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind-key -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind-key -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind-key -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
bind-key -n C-\\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
set-option -g pane-border-status top
set-option -g pane-border-format " #P: #{pane_current_command} "
set-option -sg escape-time 10
set-option -g history-limit 50000