Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xavierchow/vim-swagger-preview
A Vim plugin for previewing swagger/openAPI spec in Chrome with swagger-ui.
https://github.com/xavierchow/vim-swagger-preview
chrome openapi preview swagger swagger-ui vim
Last synced: 4 days ago
JSON representation
A Vim plugin for previewing swagger/openAPI spec in Chrome with swagger-ui.
- Host: GitHub
- URL: https://github.com/xavierchow/vim-swagger-preview
- Owner: xavierchow
- Created: 2018-09-26T04:18:47.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-04-04T09:07:04.000Z (9 months ago)
- Last Synced: 2024-04-14T22:20:45.683Z (8 months ago)
- Topics: chrome, openapi, preview, swagger, swagger-ui, vim
- Language: Shell
- Homepage:
- Size: 17.6 KB
- Stars: 28
- Watchers: 1
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Vim Swagger Preview
====================- [Intro](#intro)
- [Installation](#installation)
- [Usage](#usage)
- [License](#licnese)Intro
-----
[Swagger Editor](https://swagger.io/tools/swagger-editor/) is fancy, but my favorite editor is vim, and all my code is in vim,
I don't like to copy & paste the yaml between the swagger-editor and vim.
That's why I built this plugin; you can edit your yaml OpenAPI spec in vim and preview the result in Chrome.Installation
------------
### Prerequisite
* web browser
* docker
* make sure port `8017` is availabe to listen on, of course you can change it [here](https://github.com/xavierchow/vim-swagger-preview/blob/master/script.sh#L37).### Plugin
* With [Pathogen](https://github.com/tpope/vim-pathogen): Place `vim-swagger-preview/` in `.vim/bundle/`.
* With [Vundle](https://github.com/VundleVim/Vundle.vim):
* Add `Plugin 'xavierchow/vim-swagger-preview'` to your `.vimrc`.
* Launch `vim` and run `:PluginInstall`
* With [vim-plug](https://github.com/junegunn/vim-plug):
* Setup with [vim-plug guide](https://github.com/junegunn/vim-plug#usage)
* Add `Plug 'xavierchow/vim-swagger-preview'` to your `.vimrc`.Usage
-----### File extension
This plugin only applies to yaml file with the OpenAPI spec.### Keymap for preview
The default keymap is `e`, it brings up a browser window and shows the swagger-ui.
You can also define your keymap in vimrc.
```
nmap e GenerateDiagram
```
*Notes: Why I named it as `GenerateDiagram` is that I'd like to reuse the same mapping as [vim-sequence-diagram](https://github.com/xavierchow/vim-sequence-diagram).*License
-----------------MIT