Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search selected/entered via omnibar on background #1770

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

eugercek
Copy link
Contributor

Sometimes it feels natural to accumulate links in the background to read them later.

Solves #1757

Functionality is ready but I want to discuss defaults and some refactorings.

  1. What should be the default key for searching in the background?
    I choose ; because it's unlikely to someone assign searchAlias to ;. b for "background" is occupied by default and even if the user changes it'll probably clash with Baidu or Bing.

  2. Should we refactor?
    I think it's sufficiently hard to grasp which line adds what functionality in the current state.
    For o + alias like og for "Open Google" Control + Enter opens in background so one Omnibar is enough. But other parts have some repetitions, we can use some kind of builder, but to use a builder we need to change searchSelectedWith to something like searchSelectedWith(URL: string, options: {})

@onguarde
Copy link

Hi @eugercek ,

great work! regarding the defaults shortcut, I would prefer it to be accessible by the left hand. Frequently, we will be using the mouse to select some text before intending to background search. It will be faster to immediately trigger using the left hand.

Which letter key to use is tricky, because most seems to be used up by others.

Another option is to still use "s". But overload it.
"sg" - search google in foreground.
"sG" - search google in background.

I really like the idea above. Though I prefer the default to flipped. I search in background much more frequently.

"sG" - search google in foreground.
"sg" - search google in background.

@eugercek
Copy link
Contributor Author

Hi,

I would prefer it to be accessible by the left hand

Excellent point!

"sG" - search google in background.

sG is used for "Open OmniBar with selected text and search it new tab (not in the background)"

So we need to find another left-hand key. Using an alphabetic character is not OK since people can bind it to a search engine. Tilde is far from home row, but it's the only easy key to press with left hand.

So we could use both ; and ` for background.

I like the idea above. However, I prefer the default to flipped. I search in the background much more frequently.

I agree, but I don't want to break people's workflow; after this has merged, I'll use the below function to swap those.

function swapKeys(key1, key2, mode="map", mode_remove="unmap") {
  api[mode]("temp", key1);
  api[mode](key1, key2);
  api[mode](key2, key1);
  api[mode_remove]("temp");
}

@brookhong
Copy link
Owner

So we could use both ; and ` for background.

How about q?

@eugercek
Copy link
Contributor Author

eugercek commented Jul 28, 2022

q is ok for ergonomics, but removing q as a search alias is a bit problematic. Can we bind the space key?

@onguarde
Copy link

Seems like this is still not implemented.

@eugercek
Copy link
Contributor Author

Totally forgot this, will look at weekend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants