-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
122 lines (96 loc) · 3.84 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
111
112
113
114
115
116
117
118
119
120
# /set the default TERM
#set -g default-terminal screen
set-option -g default-shell /bin/zsh
# update the TERM variable of terminal emulator when creating a new session or attaching a existing session
#set -g update-environment 'DISPLAY SSH_ASKPASS SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY TERM'
# determine if we should enable 256-colour support
#if "[[ ${TERM} =~ 256color || ${TERM} == fbterm ]]" 'set -g default-terminal screen-256color'
set -g default-terminal "screen-256color"
set -s copy-command 'wl-copy'
#Prefix is Ctrl-a
set -g prefix C-a
bind C-a send-prefix
unbind C-b
set -sg escape-time 1
set -g base-index 1
setw -g pane-base-index 1
#Mouse works as expected
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
setw -g monitor-activity on
set -g visual-activity on
set -g mode-keys vi
set -g history-limit 10000
# y and p as in vim
bind Escape copy-mode
#bind -t vi-copy 'v' begin-selection
#bind -t vi-copy 'Space' halfpage-down
#bind -t vi-copy 'Bspace' halfpage-up
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'wl-copy -p'
#bind -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "pbcopy"
#bind -T copy-mode-vi 'y' send-keys -X copy-pipe-and-cancel "pbcopy"
# easy-to-remember split pane commands
bind | split-window -h
bind - split-window -v
unbind '"'
unbind %
# moving between panes with vim movement keys
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# moving between windows with vim movement keys
bind -r C-h select-window -t :-
bind -r C-l select-window -t :+
# resize panes with vim movement keys
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
#set -g @yank_selection 'primary'
#set -g @shell_mode 'vi'
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
#set -g @plugin 'tmux-plugins/tmux-yank'
# Setup mouse wheel
# bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e'"
# bind -n WheelDownPane select-pane -t= \; send-keys -M
# Toggle mouse on with ^B m
bind m \
set -g mouse on \;\
display 'Mouse: ON'
# Toggle mouse off with ^B M
bind M \
set -g mouse off \;\
display 'Mouse: OFF'
# 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"
# Appearance
set -g status-fg white
set -g status-bg colour235
# default window title colors
setw -g window-status-style fg=white,bg=colour235
# active window title colors
setw -g window-status-current-style fg=cyan,bg=colour235,underscore,bold
# command/message line colors
setw -g message-style fg=white,bg=black,bright
set -g set-clipboard on
set-option -g status on
set-option -g status-interval 2
#set-option -g status-utf8 on
set-option -g status-justify "centre"
set-option -g status-left-length 60
set-option -g status-right-length 90
set-option -g status-left "#(~/.tmux/tmux-powerline/powerline.sh left)"
set-option -g status-right "#(~/.tmux/tmux-powerline/powerline.sh right)"
# bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xclip -i -f -selection primary | xclip -i -selection clipboard"
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'