-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
53 lines (42 loc) · 1.8 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
# Stolen from github: benawad/dotfiles
# ctrl-space for modifier
unbind C-b
set -g prefix C-Space
bind C-Space send-prefix
# start window and pane numbering from 1
set -g base-index 1
setw -g pane-base-index 1
# renumber windows on close
set -g renumber-windows on
# have tmux remember more lines
set -g history-limit 10000
# smooth copy and pasting
# tmux < v2.1:
if-shell "[[ `tmux -V | cut -d' ' -f2` -lt 2.1 ]]" "setw -g mode-mouse off"
# tmux >= v2.1:
if-shell "[[ `tmux -V | cut -d' ' -f2` -ge 2.1 ]]" "setw -g mouse off"
# increase vim responsiveness
set -sg escape-time 0
# Smart pane switching with awareness of vim splits
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?x?)(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"
# Split the window horizontally
bind '%' split-window -h -c '#{pane_current_path}'
# Split the window vertically
bind '"' split-window -v -c '#{pane_current_path}' bind c new-window -c '#{pane_current_path}' # Create new window
set -g default-shell $SHELL
# set -g default-command "reattach-to-user-namespace -l ${SHELL}"
# fix scrolling
set -g mouse on
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
bind -n WheelDownPane select-pane -t= \; send-keys -M
# color theme
set -g status-style "bg=blue"
set -ag status-style "fg=white"
set -g default-terminal "xterm-256color"
set -ga terminal-overrides ",xterm-256color:Tc"