diff --git a/readme.md b/readme.md index 11103dc..6934f6a 100644 --- a/readme.md +++ b/readme.md @@ -34,3 +34,10 @@ To list all installed plugins type in `list`, which also accepts an argument. Clicking one will go to the plugin homepage. ![list](./screenshots/list.png) + +### Show Config + +To open the folder containing the config, or to open the config in your default +`.json` editor, try `config`: + +![config](./screenshots/config.png) diff --git a/screenshots/config.png b/screenshots/config.png new file mode 100644 index 0000000..0a40695 Binary files /dev/null and b/screenshots/config.png differ diff --git a/src/openConfig.js b/src/openConfig.js new file mode 100644 index 0000000..08325ee --- /dev/null +++ b/src/openConfig.js @@ -0,0 +1,13 @@ +module.exports = (pluginContext) => { + return (query, env = {}) => { + return new Promise((resolve, reject) => { + resolve([ + { + icon: 'fa-file-text', + title: 'Open Zazu Configuration', + value: '~/.zazurc.json', + } + ]) + }) + } +} diff --git a/src/showConfig.js b/src/showConfig.js new file mode 100644 index 0000000..d64586e --- /dev/null +++ b/src/showConfig.js @@ -0,0 +1,13 @@ +module.exports = (pluginContext) => { + return (query, env = {}) => { + return new Promise((resolve, reject) => { + resolve([ + { + icon: 'fa-file-text', + title: 'Show Zazu Configuration', + value: '~/.zazurc.json', + } + ]) + }) + } +} diff --git a/zazu.json b/zazu.json index bc454ef..471effa 100644 --- a/zazu.json +++ b/zazu.json @@ -37,6 +37,24 @@ "args": "Optional", "script": "src/list.js", "connections": ["GotoRepo"] + }, + { + "id": "ShowConfig", + "type": "PrefixScript", + "prefix": "config", + "space": false, + "args": "None", + "script": "src/showConfig.js", + "connections": ["ShowFile"] + }, + { + "id": "OpenConfig", + "type": "PrefixScript", + "prefix": "config", + "space": false, + "args": "None", + "script": "src/openConfig.js", + "connections": ["OpenFile"] } ], "output": [ @@ -62,6 +80,14 @@ "type": "SendNotification", "title": "Packages Updated", "message": "Your packages have been updated. Reload your configuration to see your changes." + }, + { + "id": "ShowFile", + "type": "ShowFile" + }, + { + "id": "OpenFile", + "type": "OpenFile" } ] }