File tree Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ In tmux copy mode:
11
11
- ` o ` - "open" a highlighted selection with the system default program. ` open `
12
12
for OS X or ` xdg-open ` for Linux.
13
13
- ` Ctrl-o ` - open a highlighted selection with the ` $EDITOR `
14
+ - ` Shift-s ` - search the highlighted selection directly inside a search engine (defaults to google).
14
15
15
16
### Examples
16
17
@@ -22,6 +23,7 @@ In copy mode:
22
23
- highlight ` http://example.com ` and press ` o ` - link will be opened in the
23
24
default browser.
24
25
- highlight ` file.txt ` and press ` Ctrl-o ` - file will open in ` $EDITOR ` .
26
+ - highlight ` TypeError: 'undefined' is not a function ` and press ` Shift-s ` - the text snipped will be searched directly inside google by default
25
27
26
28
### Screencast
27
29
@@ -64,6 +66,21 @@ Put `set -g @open 'x'` in `tmux.conf`.
64
66
65
67
Put ` set -g @open-editor 'C-x' ` in ` tmux.conf ` .
66
68
69
+ > How can I change the default search engine to "duckduckgo" or any other one?
70
+
71
+ Put ` set -g @open-S 'https://www.duckduckgo.com/' ` in ` tmux.conf `
72
+
73
+ > How can I use multiple search engines?
74
+
75
+ Put:
76
+
77
+ ```
78
+ set -g @open-B 'https://www.bing.com/search?q='
79
+ set -g @open-S 'https://www.google.com/search?q='
80
+ ```
81
+
82
+ in ` tmux.conf `
83
+
67
84
### Other goodies
68
85
69
86
` tmux-open ` works great with:
Original file line number Diff line number Diff line change @@ -122,8 +122,14 @@ set_copy_mode_open_search_bindings() {
122
122
for engine_var in $stored_engine_vars ; do
123
123
engine=" $( get_engine " $engine_var " ) "
124
124
125
- tmux bind-key -t vi-copy " $engine_var " copy-pipe " $( generate_open_search_command " $engine " ) "
126
- tmux bind-key -t emacs-copy " $engine_var " copy-pipe " $( generate_open_search_command " $engine " ) "
125
+ if tmux-is-at-least 2.4; then
126
+ tmux bind-key -T copy-mode-vi " $engine_var " send-keys -X copy-pipe-and-cancel " $( generate_open_search_command " $engine " ) "
127
+ tmux bind-key -T copy-mode " $engine_var " send-keys -X copy-pipe-and-cancel " $( generate_open_search_command " $engine " ) "
128
+ else
129
+ tmux bind-key -t vi-copy " $engine_var " copy-pipe " $( generate_open_search_command " $engine " ) "
130
+ tmux bind-key -t emacs-copy " $engine_var " copy-pipe " $( generate_open_search_command " $engine " ) "
131
+ fi
132
+
127
133
done
128
134
}
129
135
You can’t perform that action at this time.
0 commit comments