@@ -5,48 +5,49 @@ default_pane_resize="5"
5
5
# tmux show-option "q" (quiet) flag does not set return value to 1, even though
6
6
# the option does not exist. This function patches that.
7
7
get_tmux_option () {
8
- local option=$1
9
- local default_value=$2
10
- local option_value=$( tmux show-option -gqv " $option " )
11
- if [ -z $option_value ]; then
12
- echo $default_value
13
- else
14
- echo $option_value
15
- fi
8
+ local option=$1
9
+ local default_value=$2
10
+ local option_value=$( tmux show-option -gqv " $option " )
11
+ if [ -z $option_value ]; then
12
+ echo $default_value
13
+ else
14
+ echo $option_value
15
+ fi
16
16
}
17
17
18
18
pane_navigation_bindings () {
19
- tmux bind-key h select-pane -L
20
- tmux bind-key C-h select-pane -L
21
- tmux bind-key j select-pane -D
22
- tmux bind-key C-j select-pane -D
23
- tmux bind-key k select-pane -U
24
- tmux bind-key C-k select-pane -U
25
- tmux bind-key l select-pane -R
26
- tmux bind-key C-l select-pane -R
19
+ tmux bind-key h select-pane -L
20
+ tmux bind-key C-h select-pane -L
21
+ tmux bind-key j select-pane -D
22
+ tmux bind-key C-j select-pane -D
23
+ tmux bind-key k select-pane -U
24
+ tmux bind-key C-k select-pane -U
25
+ tmux bind-key l select-pane -R
26
+ tmux bind-key C-l select-pane -R
27
27
}
28
28
29
29
pane_resizing_bindings () {
30
- local pane_resize=$( get_tmux_option " @pane_resize" " $default_pane_resize " )
31
- tmux bind-key -r H resize-pane -L " $pane_resize "
32
- tmux bind-key -r J resize-pane -D " $pane_resize "
33
- tmux bind-key -r K resize-pane -U " $pane_resize "
34
- tmux bind-key -r L resize-pane -R " $pane_resize "
30
+ local pane_resize=$( get_tmux_option " @pane_resize" " $default_pane_resize " )
31
+ tmux bind-key -r H resize-pane -L " $pane_resize "
32
+ tmux bind-key -r J resize-pane -D " $pane_resize "
33
+ tmux bind-key -r K resize-pane -U " $pane_resize "
34
+ tmux bind-key -r L resize-pane -R " $pane_resize "
35
35
}
36
36
37
37
pane_split_bindings () {
38
- tmux bind-key " |" split-window -h -c " #{pane_current_path}"
39
- tmux bind-key " -" split-window -v -c " #{pane_current_path}"
38
+ tmux bind-key " |" split-window -h -c " #{pane_current_path}"
39
+ tmux bind-key " -" split-window -v -c " #{pane_current_path}"
40
40
}
41
41
42
42
improve_new_window_binding () {
43
- tmux bind-key " c" new-window -c " #{pane_current_path}"
43
+ tmux bind-key " c" new-window -c " #{pane_current_path}"
44
44
}
45
45
46
46
main () {
47
- pane_navigation_bindings
48
- pane_resizing_bindings
49
- pane_split_bindings
50
- improve_new_window_binding
47
+ pane_navigation_bindings
48
+ window_move_bindings
49
+ pane_resizing_bindings
50
+ pane_split_bindings
51
+ improve_new_window_binding
51
52
}
52
53
main
0 commit comments