File tree Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 3
3
### master
4
4
- add other plugins list to the README
5
5
- update readme to reflect github organization change
6
+ - add alternate session key binding ` prefix + S `
6
7
7
8
### v1.0.0, 2014-06-01
8
9
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ don't need to look it up.
33
33
` p ` , ` r ` or ` j ` in ` goto-session ` prompt will switch you to the respective
34
34
project.<br />
35
35
This is actually a Tmux feature and it helps a lot.
36
+ - ` prefix + S ` switches to the last session
36
37
37
38
### Installation with [ Tmux Plugin Manager] ( https://github.com/tmux-plugins/tpm ) (recommended)
38
39
Original file line number Diff line number Diff line change @@ -5,6 +5,9 @@ CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
5
5
default_key_bindings=" g"
6
6
tmux_option=" @goto_session_key"
7
7
8
+ default_key_bindings_alternate=" S"
9
+ tmux_option_alternate=" @goto_alternate_session_key"
10
+
8
11
# tmux show-option "q" (quiet) flag does not set return value to 1, even though
9
12
# the option does not exist. This function patches that.
10
13
get_tmux_option () {
@@ -21,12 +24,24 @@ get_tmux_option() {
21
24
# Multiple bindings can be set. Default binding is "g".
22
25
set_goto_session_bindings () {
23
26
local key_bindings=$( get_tmux_option " $tmux_option " " $default_key_bindings " )
27
+ local key
24
28
for key in $key_bindings ; do
25
29
tmux bind-key " $key " run-shell " $CURRENT_DIR /scripts/tmux_goto_session.sh"
26
30
done
27
31
}
28
32
33
+ set_alternate_session_binding () {
34
+ local key_bindings=$( get_tmux_option " $tmux_option_alternate " " $default_key_bindings_alternate " )
35
+ local key
36
+ for key in $key_bindings ; do
37
+ # switch to the last/alternate session
38
+ tmux bind-key " $key " switch-client -l
39
+ done
40
+ }
41
+
42
+
29
43
main () {
30
44
set_goto_session_bindings
45
+ set_alternate_session_binding
31
46
}
32
47
main
You can’t perform that action at this time.
0 commit comments