-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.zsh.conf
129 lines (100 loc) · 4.28 KB
/
tmux.zsh.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
121
122
123
124
125
126
127
128
129
###############################################################################
# set the default prefix key conbination
# not using Ctrl-a for cursor control
#set prefix C-a
set-option -g prefix C-s
# and unbind C-b is not acceptable to free it up
unbind-key C-b
bind-key C-s send-prefix
set-option -g status-keys vi
set-option -g base-index 1
# synchronize panes (Pane들 동시컨트롤)
#bind g setw synchronize-pane
#bind C-a setw synchronize-pane
bind C-s setw synchronize-pane
# vim's definition of a horizontal/vertical split is reversed from tmux's
# split vertically default prefix key: %
bind - split-window -v
# split horizantally default prefix key: "
bind | split-window -h
# move around panes with hjkl, as one would in vim after pressing ctrl-w
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# change history limit = scrollback buffer size
set-option -g history-limit 90000
###############################################################################
# start the zshell for each new window
#set-option -g default-command "reattach-to-user-namespace -l zsh"
set-option -g default-shell /bin/zsh
###############################################################################
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin 'git@github.com/user/plugin'
# set -g @plugin 'git@bitbucket.com/user/plugin'
###############################################################################
# Solarized theme
set -g @plugin 'seebi/tmux-colors-solarized'
set -g @colors-solarized 'dark'
# make tmux display things in 256 colors
set -g default-terminal "screen-256color"
set -ga terminal-overrides ",xterm-256color:Tc"
###############################################################################
# Move window
bind-key S-Left swap-window -t -1
bind-key S-Right swap-window -t +1
###############################################################################
# Resize pane
set -g repeat-time 1000
#bind-key -r C-k resize-pane -U 5
#bind-key -r C-j resize-pane -D 5
#bind-key -r C-h resize-pane -L 5
#bind-key -r C-l resize-pane -R 5
bind-key -r -T prefix C-k resize-pane -U 5
bind-key -r -T prefix C-j resize-pane -D 5
bind-key -r -T prefix C-h resize-pane -L 5
bind-key -r -T prefix C-l resize-pane -R 5
#bind C-k resize-pane -U 5
#bind C-j resize-pane -D 5
#bind C-h resize-pane -L 5
#bind C-l resize-pane -R 5
###############################################################################
# ---------------------
# copy & paste
# ---------------------
# begin copy mode default prefix key: [
# use 'SPACE' to select
# use 'ENTER' to copy
# paste default prefix key: ]
# use vim keybindings in copy mode
set-window-option -g mode-keys vi
###############################################################################
# ---------------------
# capture and save pane
# ---------------------
# https://unix.stackexchange.com/questions/26548/write-all-tmux-scrollback-to-a-file
bind-key P command-prompt -p 'save history to filename:' -I '~/tmux.history' 'capture-pane -S - ; save-buffer %1 ; delete-buffer'
###############################################################################
# ---------------------
# set status bar
# ---------------------
# show window & pane number on left side of status bar
set -g status-left-length 60
#set -g status-left "#[fg=colour240]#H:#I:#P: "
set -g status-left "#[fg=white]#h:#[fg=red,bold]#I#[fg=white]:#[fg=green,bold]#P#[fg=white]: "
# show status
set -g window-status-current-format '#[fg=white,bold]#I.#[fg=green]#{pane_current_command} #[fg=white]|'
set -g window-status-format '#I.#(pwd="#{pane_current_path}"; echo ${pwd####*/})#[fg=green]#F #[fg=green]|'
# show host name, IP, date and time on right side of status bar
set -g status-right-length 50
#set -g status-right '#[fg=colour174]#(mpc) #[fg=colour187,bold]%H:%M:%S'
set -g status-right "#[fg=green]:#H:#[fg=colour187,bold]#(ifconfig eth0 | grep 'inet addr:' | awk '{print $2}' | sed 's/addr://'): %D %l:%M %p "
# xterm-style function key sequences
setw -g xterm-keys on
###############################################################################
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
#run -b '~/.tmux/plugins/tpm/tpm'