-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
85 lines (76 loc) · 3.08 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
# Note that ^ stand for ctrl
#-- bindkeys --#
# prefix key (ctrl+w)
unbind ^b
# set -g prefix ^w
# bind ^w send-prefix
set -g prefix M-`
bind M-` send-prefix
#-- base settings --#
# What is the difference between screen-256 color and xterm-256color
# set -g default-terminal "screen-256"
set -ga terminal-overrides ",xterm-termite:Tc"
set -g default-terminal "xterm-256"
# http://superuser.com/questions/424086/what-is-the-difference-between-screen-256-color-and-xterm-256color
set -g escape-time 0 # Faster Command Sequences
# http://unix.stackexchange.com/questions/23138/esc-key-causes-a-small-delay-in-terminal-due-to-its-alt-behavior
set -g history-limit 65535
set -g base-index 1
set -g pane-base-index 1
# Create new-window with current directory in tmux
# https://unix.stackexchange.com/questions/12032/create-new-window-with-current-directory-in-tmux#
# create
bind c new-window -c "#{pane_current_path}"
# split
unbind '"'
bind - split-window -v -c "#{pane_current_path}" # vertical split (prefix -)
unbind %
bind | split-window -h -c "#{pane_current_path}" # horizontal split (prefix |)
# select
bind h select-pane -L # left (prefix h)
bind j select-pane -D # down (prefix j)
bind k select-pane -U # above (prefix k)
bind l select-pane -R # right (prefix l)
# resize
# bind -r ^k resize-pane -U 10 # upward (prefix Ctrl+k)
# bind -r ^j resize-pane -D 10 # downward (prefix Ctrl+j)
# bind -r ^h resize-pane -L 10 # to the left (prefix Ctrl+h)
# bind -r ^l resize-pane -R 10 # to the right (prefix Ctrl+l)
# kill
bind q killp # kill pane (prefix q)
#pane movement
# bind-key j command-prompt -p "join pane from:" "join-pane -s '%%'"
bind-key s command-prompt -p "send pane to:" "join-pane -t '%%'"
# copy mode
setw -g mode-keys vi
bind y copy-mode # enter copy mode (prefix y)
bind-key -T copy-mode-vi v send-keys -X begin-selection # select (v)
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xclip -i -f -selection primary | xclip -i section clipboard" # copy (y)
bind-key p run "xsel -o | tmux load-buffer - ; tmux paste-buffer" # paste (p)
set -g mouse on
bind -T root WheelUpPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; copy-mode -e; send-keys -M"
bind -T root WheelDownPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; send-keys -M"
# scroll like vim
# bind -t vi-copy f page-down
# bind -t vi-copy b page-up
# bind -t vi-copy d halfpage-down
# bind -t vi-copy u halfpage-up
# https://wiki.archlinux.org/index.php/Tmux#X_clipboard_integration
# zoom pane <-> window
# bind z run "tmux-zoom"
##
# reload config (prefix r)
bind r source-file ~/.tmux.conf \; display "Configuration reloaded!"
#-- statusbar --#
set -g status on
set -g status-interval 0
set -g status-keys vi
set -g status-justify centre
set -g status-left ""
set -g status-right ""
set -g status-style "bg=black"
# Eat my big powerline!!!
set-window-option -g window-status-format "#[fg=white, bg=red]#I #W #[fg=red, bg=black]"
set-window-option -g window-status-current-format "#[fg=white, bg=blue] #I #W #[fg=blue, bg=black]"
# hight
set-window-option -g mode-style bg=black,fg=white