Sublime Forum

ST3 macros - passing selection to a command

#1

I want to do a web search based on the current selection to simulate context sensitive help for Rust.

So, if the text selection is “fmt”, I want to bind a macro to a key that will open the URL “http://doc.rust-lang.org/std/?search=fmt” (ideally in the same browser window each time, but if it opens a new window each time that’s ok).

I can’t find a way to obtain the current selection within the macro, in order to then build a system command that includes it (or use open_url if that would work).

Is there a way to do this using macros?

If not, is there a plugin that does this (or which would be easy to modify)?

Thanks,

Mark

1 Like