Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ Put `set -g @open-editor 'C-x'` in `tmux.conf`.

Put `set -g @open-S 'https://www.duckduckgo.com/?q='` in `tmux.conf`

> How can I change the default open command?

Put `set -g @open-command 'wsl-open'` in `tmux.conf`

> How can I use multiple search engines?

Put:
Expand Down
11 changes: 9 additions & 2 deletions open.tmux
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ source "$CURRENT_DIR/scripts/helpers.sh"

default_open_key="o"
open_option="@open"
open_command="@open-command"

default_open_editor_key="C-o"
open_editor_option="@open-editor"
Expand Down Expand Up @@ -51,7 +52,10 @@ search_command_generator() {
}

generate_open_command() {
if is_osx; then
local custom_open_command=$(get_tmux_option "$open_command")
if [ -n "$custom_open_command" ]; then
echo "$(command_generator "$custom_open_command")"
elif is_osx; then
echo "$(command_generator "open")"
elif is_cygwin; then
echo "$(command_generator "cygstart")"
Expand All @@ -65,7 +69,10 @@ generate_open_command() {

generate_open_search_command() {
local engine="$1"
if is_osx; then
local custom_open_command=$(get_tmux_option "$open_command")
if [ -n "$custom_open_command" ]; then
echo "$(search_command_generator "$custom_open_command" "$engine")"
elif is_osx; then
echo "$(search_command_generator "open" "$engine")"
elif is_cygwin; then
echo "$(command_generator "cygstart")"
Expand Down