Skip to content

Commit

Permalink
Snippets for Request, Response and parameters.
Browse files Browse the repository at this point in the history
  • Loading branch information
codeinabox committed Jun 7, 2016
1 parent 48e23f9 commit d8aca9f
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Expand Up @@ -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)
Expand Down
25 changes: 25 additions & 0 deletions 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 <identifier> (application/json)"
+ Request ${1} (${2:application/json})

${3:{}}
snippet res "+ Response 200 (..)"
+ Response ${1:200} (${2:application/json})

${0:{}}
snippet rres "+ Request <identifier> (application/json) ... + Response 200 (application/json)"
+ Request ${1} (${2:application/json})

${3:{}}

+ Response ${4:200} (${4:$2})

${0:{}}

0 comments on commit d8aca9f

Please sign in to comment.