-
Notifications
You must be signed in to change notification settings - Fork 100
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
Allow shortcuts without parameters #329
Allow shortcuts without parameters #329
Conversation
src/main.c
Outdated
@@ -252,8 +252,8 @@ gboolean vb_load_uri(Client *c, const Arg *arg) | |||
rp = realpath(path, NULL); | |||
uri = g_strconcat("file://", rp, NULL); | |||
free(rp); | |||
} else if (strchr(path, ' ') || !strchr(path, '.')) { | |||
/* use a shortcut if path contains spaces or no dot */ | |||
} else if (!strchr(path, '.')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this really needed for the parameter free shortcuts? I've added the strchr(path, ' ')
to allow to search for something containing dots like "document.activeElement". This would not work without the check for space.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are totally right, my bad. I misinterpreted the condition. I will update the commit.
813a9c8
to
4860da8
Compare
Updated, not removing the check for space anymore. |
Tank you! |
Could be this also merged into master branch? |
@aksr I've applied the changes to the master branch too. |
Thank you. |
This change provides a simple way to allow calling shortcuts without parameters.
I see several positive effects:
Navigate to your favourite pages via shortcuts
Without necessarily going to search there but check the news feed or what so ever.
Compromise for #284
You could now do:
So you would have to define two shortcuts, but basically it allows the workflow @aksr requested.
Compromise for #181
Say you set a duckduckgo short via:
You can now
:open du some search string
as usual. But you can also just:open du
which will bring you to the duckduckgo front page featuring search suggestions. Several search engines I tested send you to the search front page if the url query was empty. So it's a way to rapidly access search suggestions without vimb implementing it :) Maybe it helps the workflow of @257What do you think?