blob: 060ae8df788b1d316011c81fee465b858a0711ab (
plain)
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
|
#-------- Common Settings {{{
#------------------------------------------------------
# how to use tmux demo video: http://www.youtube.com/watch?v=ZNM1KfqpyGo
# https://gist.github.com/1147532
# http://crunchbanglinux.org/forums/post/236199/
# https://gist.github.com/adinapoli/4723872
# change prefix key to Ctrl-a; like GNU Screen
#unbind-key C-b
#set-option -g prefix C-a
# goto last used window
bind-key C-a last-window
# Nested Tmux Session
# send to tmux session within another tmux session; like screen
bind-key a send-prefix
# fix delay time between tmux & vim
set-option -sg escape-time 0
# default shell
set-option -g default-command /bin/zsh
set-option -g default-shell /bin/zsh
# reload config
bind-key r source-file ~/.tmux.conf \; display-message "Configuration reloaded"
# edit config
bind-key e new-window -n 'conf' '${EDITOR:-vim} ~/.tmux.conf && tmux source ~/.tmux.conf && tmux display "~/.tmux.conf sourced"'
bind-key '/' new-window 'man tmux'
# clear screen and scrollback history
bind-key -n C-l send-keys C-l \; run 'tmux clear-history'
# set display timelimit
set-option -g display-panes-time 2000
set-option -g display-time 1000
# history size
set-option -g history-limit 10000
# enable shell hotkeys C-left/C-right
# http://sigizmund.com/tmux-and-c-leftc-right/
set-window-option -g xterm-keys on
# enable 256 color terminal
# http://blog.sanctum.geek.nz/256-colour-terminals/
set-option -g default-terminal "screen-256color"
# --- }}}
#-------- Keybinding (Vim Style) {{{
#------------------------------------------------------
# vim keys in command prompt
set-option -g status-keys vi
# unicode
set-window-option -g utf8 on
# select panes
bind-key k select-pane -U
bind-key h select-pane -L
bind-key j select-pane -D
bind-key l select-pane -R
# cycle windows/panes (no prefix)
bind-key -n M-k select-pane -t :.- # prev pane
bind-key -n M-j select-pane -t :.+ # next pane
bind-key -n M-h select-window -t :- # previous window
bind-key -n M-l select-window -t :+ # next window
# resize panes
bind-key -r J resize-pane -D 1
bind-key -r K resize-pane -U 1
bind-key -r H resize-pane -L 1
bind-key -r L resize-pane -R 1
# better pane split bindings with current path (tmux 1.9+)
bind-key \ split-window -h -c "#{pane_current_path}" # vertical split
bind-key - split-window -v -c "#{pane_current_path}" # horizontal split
# new window/pane with the current path (tmux 1.9+)
bind-key c new-window -c "#{pane_current_path}"
# kill window/pane without prompt
# http://unix.stackexchange.com/a/30283
bind-key & kill-window
bind-key x kill-pane
# sync panes; send what you are typing to other panes.
bind-key C-s set-window-option synchronize-panes
# --- }}}
# music --- {{{
bind-key C-m new-window -n music -c $HOME \; \
send-keys 'clear && figlet -w 40 Radio' 'Enter' \; \
split-window -v -p 70 -t 1 \; \
send-keys 'ncmpcpp -s visualizer' 'Enter' \; \
split-window -v -p 50 -t 2 \; \
send-keys 'ncmpcpp -s playlist' 'Enter' \; \
split-window -h -p 60 -t 1 \; \
send-keys 'clear && figlet -w 40 Search Music' 'Enter' \; \
select-pane -t 1
# --- }}}
|