From d8aca9f3ab6dbc5467f78962ed3969d3d0c485cc Mon Sep 17 00:00:00 2001 From: Mathew Attlee Date: Tue, 7 Jun 2016 12:28:49 +0100 Subject: [PATCH] Snippets for Request, Response and parameters. --- README.md | 4 ++++ snippets/apiblueprint.snippets | 25 +++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 snippets/apiblueprint.snippets diff --git a/README.md b/README.md index 75cd30c..8b91294 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,10 @@ structure for your API Blueprint in a split. If you have [TagBar](https://github.com/majutsushi/tagbar) installed you can use it to list and jump to groups and resources. +### Snippets + +The are snippets in the snipMate format, supported by many Vim snippet plug-ins. + ## Installation ### With [vim-plug](https://github.com/junegunn/vim-plug) (recommended) diff --git a/snippets/apiblueprint.snippets b/snippets/apiblueprint.snippets new file mode 100644 index 0000000..eeab6cf --- /dev/null +++ b/snippets/apiblueprint.snippets @@ -0,0 +1,25 @@ +snippet api "FORMAT: 1A ... # Title" + FORMAT: 1A + + # ${1:Title} + + ${2:Description for $1} +snippet param "+ name:`example` (string, required) - description .. + Default: `value`" + + ${1:name}: \`${2:example}\` (${3:type}, ${4:required}) - ${5:$1 description} + + Default: \`${6:value}\` +snippet req "+ Request (application/json)" + + Request ${1} (${2:application/json}) + + ${3:{}} +snippet res "+ Response 200 (..)" + + Response ${1:200} (${2:application/json}) + + ${0:{}} +snippet rres "+ Request (application/json) ... + Response 200 (application/json)" + + Request ${1} (${2:application/json}) + + ${3:{}} + + + Response ${4:200} (${4:$2}) + + ${0:{}}