Skip to content

Instantly share code, notes, and snippets.

@pomeh
Created January 14, 2015 12:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pomeh/1bd051af0dea5e8af93b to your computer and use it in GitHub Desktop.
Save pomeh/1bd051af0dea5e8af93b to your computer and use it in GitHub Desktop.
Sublime Text 3 config example for sublime_findDoc package
// see Sublime Text package findDoc at https://github.com/zckrs/sublime_findDoc
[
// multiple shortcuts => multiple website
// aka: search on Google
{
"keys": ["ctrl+k", "ctrl+g"],
"command": "find_doc_selection",
"args" : {"url" : "https://google.fr/#q=%s" }
},
// aka: search on Mozilla Developer Network
{
"keys": ["ctrl+k", "ctrl+m"],
"command": "find_doc_selection",
"args" : {"url" : "https://developer.mozilla.org/fr/search?q=%s" }
},
// aka: search on devdocs.io
{
"keys": ["ctrl+k", "ctrl+k"],
"command": "find_doc_selection",
"args" : {"url" : "http://devdocs.io/#q=%s" }
},
// reuse the same keys shortcut, but got to a different URL based on curret context
// aka: search on usejsdoc.io only if:
// - we are in a JavaScript block comment
// - the current line is like the following:
// * ' * @param xxx'
// * ' * @returns xxx'
// * ' * @typedef xxx'
// * ...
{
"keys": ["ctrl+k", "ctrl+k"],
"command": "find_doc_selection",
"args" : {"url" : "http://usejsdoc.org/tags-%s.html" },
"context": [
{
"key": "selector",
"operator": "equal",
"operand": "comment.block.documentation.js",
"match_all": true
},
{
"key": "preceding_text",
"operator": "regex_contains",
"operand": "\\s+\\*\\s@\\w*$",
"match_all": true
}
]
}
// be creative !
// why not open http://nodejs.org/api/ when editing a node.js file ?
// or going to http://www.css3.info/ when editing a CSS3 property ?!
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment