Jump to content

Recommended Posts

I'm gonna surf this wave of responsiveness from you, @bogdansrc, and ask something else that's been bothering me : it would be really cool to be able to copy the name of a function right from alfred. 

Often I'm looking up the correct spelling or the full name of a function and I'd just want to copy that...

 

I'd love to add that, as well as some other actions, like direct expand for snippets. The problem is that I can't define subtitles for when a modifier key is pressed. So this means that when you have a search result selected in Alfred and you press CMD, I can't change the subtitle text to "Copy name of function" or whatever.

Link to comment

I'd love to add that, as well as some other actions, like direct expand for snippets. The problem is that I can't define subtitles for when a modifier key is pressed. So this means that when you have a search result selected in Alfred and you press CMD, I can't change the subtitle text to "Copy name of function" or whatever.

 

Without the change in the subtitle, it would still be a great feature to have. I know that it's one I would use quite often. Atom/ST3 take care of some of those expansions, but Dash would fill the rest of the ones that I need. (btw -- Dash user for a while now and a Dash-lover for just as long).

Link to comment

I'd love to add that, as well as some other actions, like direct expand for snippets. The problem is that I can't define subtitles for when a modifier key is pressed. So this means that when you have a search result selected in Alfred and you press CMD, I can't change the subtitle text to "Copy name of function" or whatever.

Sure you can. I do it in this workflow (I'm assuming you generate info.plist programatically).

In the connections dictionary in info.plist you can change the modifiers (1048576 is CMD, IIRC) and the modifiersubtext to Copy to Clipboard or whatever.

Link to comment

Sure you can. I do it in this workflow (I'm assuming you generate info.plist programatically).

In the connections dictionary in info.plist you can change the modifiers (1048576 is CMD, IIRC) and the modifiersubtext to Copy to Clipboard or whatever.

 

Dash returns results of 2 types: snippets and doc pages. What you describe allows me to define a global modifier subtext, while what I need is to define different modifier subtexts based on the result type.

Link to comment

:) No, indeed it wouldn't.

 

But what are the alternatives? Not add expansion functionality? Provide no information and hope users guess? Add a separate script filter for snippets? Expand snippets by default instead of opening them in Dash (seems a more natural thing to do with a snippet)?

Link to comment

The alternative is to not do anything and wait for when I can do it properly. Users get annoyed by half-baked features, while very few get annoyed by missing features.

 

Snippets are currently opened in Dash when you press Enter in Alfred, and if you press Enter again (while in Dash) they get expanded. It's just one extra key press. If I'd make it so that you can only expand snippets from Alfred, I'd get complaints from users that want to find a snippet to edit it or do something else.

Link to comment

It could also just be a hidden feature that is described in the readme or any help file. Then there is no extra text needed. I'm assuming most anyone who would use this sort of integration would be one to read documentation anyway. After all, Dash is documentation.

Link to comment

Great news! Andrew just sent me a beta build of Alfred which adds support for workflows to define custom subtexts based on modifiers.

 

I'm going to start adding support for this today and it should be part of the next update of Dash.

 

Modifiers and actions I'll implement

1. CMD - open in browser (for doc pages) and expand & paste (for snippets)

2. ALT - copy result name (for doc pages) and expand & copy (for snippets)

3. No idea. What else?

Link to comment

That's very sweet! Love this functionality already! 

 

Isn't is possible to get the result in clipboard with CMD+C? Somehow most workflow work that way without any additional scripting (just tried with my google translate workflow). 

 

What about user definable modifier keys? Not a very big deal but I prefer using FN and CTRL with alfred for some reason...

 

I haven't tried to think that one through and it's 5am here and I'm fighting mosquitoes but : what about a full function auto snippet ? Say I'm looking up "js split", and on enter (+modif. key), it pastes ".split(separator)".

Link to comment

To expand & copy snippets I need to get a callback to Dash. Pressing CMD+C doesn't do that.

 

Due to the dynamic nature of the Dash Alfred workflow, I can't allow customisable modifier keys without making a separate interface for that inside Dash, which I won't at least for now.

 

 

I haven't tried to think that one through and it's 5am here and I'm fighting mosquitoes but : what about a full function auto snippet ? Say I'm looking up "js split", and on enter (+modif. key), it pastes ".split(separator)".

 

That's not possible. Dash just displays doc pages, it has no notion of .split syntax or how to use it or generate code for it.

Link to comment
  • 3 weeks later...

I've noticed that Dash loses my search hotkey every time I update. This is a minor gripe, but could Dash preserve the hotkey I set by copying it to the workflow it generates?

 

Thanks for an excellent app with stellar Alfred integration :)

 

This is a known bug and it should be fixed in the next bug.

 

Just to make sure it's not a different bug: what do you mean by "every time I update"? What do you update? Dash or Alfred? Did you find any set of steps which when performed will cause the hotkey to be lost?

Link to comment

Just to make sure it's not a different bug: what do you mean by "every time I update"? What do you update? Dash or Alfred? Did you find any set of steps which when performed will cause the hotkey to be lost?

 

When I say "every time I update", I'm referring to updating Dash via the MAS. To replicate the issue, you simply update Dash (either manually or by letting Mavericks' Automatic Updates do it).

 

Other than that, the hotkey is stable and awesome :)

Link to comment
  • 7 months later...

Is there a modifier or way that I'm missing to just search for and paste in a code snippet from Dash?

I know there is a profile inside Dash called "Search Snippets" that restricts searching to snippets only and setting that inside dash seems affect what the dash keyword returns in Alfred. The think is sometimes I want to search Dash's docs and sometimes I want to search Dash's snippets.

Maybe a separate keyword?

Link to comment

Is there a modifier or way that I'm missing to just search for and paste in a code snippet from Dash?

I know there is a profile inside Dash called "Search Snippets" that restricts searching to snippets only and setting that inside dash seems affect what the dash keyword returns in Alfred. The think is sometimes I want to search Dash's docs and sometimes I want to search Dash's snippets.

Maybe a separate keyword?

 

The default action is to paste the snippet, so there's no modifier required for that.

 

You can add "keyword triggers" to search profiles within Dash and any keyword you add will also be available in the Alfred workflow. For instructions on how to add keywords to search profiles, see http://kapeli.com/dash_guide#searchProfiles.

Link to comment

Any update on the possibility to copy a result with cmd+C? I know it's a simple field in alfred's results <copy>text to be copied on cmd+C</copy>

And what about pasting with syntax? Most, if not all, documentation pages have a very clear "syntax" section for each construct.

And even beyond all that, what about pasting a "dynamic" syntax in sublime text? Like after pasting, pressing tab iterates through the fields to modify.

 

This workflow is definitely the one i use the most and I'd love to see some evolution ;-)

Link to comment
You can copy a result by triggering it using the ALT modifier. It's the first time I hear of the <copy> field. Can you point me to the docs for it?
 

And what about pasting with syntax? Most, if not all, documentation pages have a very clear "syntax" section for each construct.

And even beyond all that, what about pasting a "dynamic" syntax in sublime text? Like after pasting, pressing tab iterates through the fields to modify.

 

Are you trying to replace your IDE's autocomplete with the Dash workflow?

 

This is very very hard to add and the benefit from it is minimal.
 
It's also beyond the scope of Dash. Dash is about docs, Dash is not supposed to provide some autocomplete functionality for your editor. That's up to your IDE to provide.
 

This workflow is definitely the one i use the most and I'd love to see some evolution ;-)

 

If you have any other feature suggestions, let me know. I'm happy to add new things.

Link to comment

It's actually not <copy></copy> but <text type="copy"></text>. I got confused. For more info: https://github.com/shawnrice/alfred-documentation/wiki/Alfred-XML

 

As for the autocomplete, it was just an idea. I like how it behaves on sublime text. But the ability to paste the full syntax and not just the function's name would definitely be good.

On the other hand, I do think it would be very doable to have the autocomplete feature in sublime text. Their snippet scheme is very straightforward (http://docs.sublimetext.info/en/latest/extensibility/snippets.html) and all language docs have easily identifiable syntax fields and they share some syntax themselves: return_type function_name ( required_var [, non_required_var = default_value] ).

 

What do you think?

Link to comment

It's actually not <copy></copy> but <text type="copy"></text>. I got confused. For more info: https://github.com/shawnrice/alfred-documentation/wiki/Alfred-XML

 

As for the autocomplete, it was just an idea. I like how it behaves on sublime text. But the ability to paste the full syntax and not just the function's name would definitely be good.

On the other hand, I do think it would be very doable to have the autocomplete feature in sublime text. Their snippet scheme is very straightforward (http://docs.sublimetext.info/en/latest/extensibility/snippets.html) and all language docs have easily identifiable syntax fields and they share some syntax themselves: return_type function_name ( required_var [, non_required_var = default_value] ).

 

What do you think?

 

Again, Dash is not about autocomplete. Dash is about docs. This is something your IDE should do, not Dash.

Link to comment
  • 1 year later...

Great news! Andrew just sent me a beta build of Alfred which adds support for workflows to define custom subtexts based on modifiers.

 

I'm going to start adding support for this today and it should be part of the next update of Dash.

 

Modifiers and actions I'll implement

1. CMD - open in browser (for doc pages) and expand & paste (for snippets)

2. ALT - copy result name (for doc pages) and expand & copy (for snippets)

3. No idea. What else?

 

 

I just discovered that the shift key is supported in many url-oriented workflows for previews.

 

like this movie and tv search (if you hit shift while having a movie selected it shows the movie poster and description)

 

Since the HTML is there, would be really nice if in addition to the "CMD to open in browser" it could support "shift to preview".

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...