Skip to content

A small plugin-wrapper over HttpYac for (neo)vim

License

Notifications You must be signed in to change notification settings

oxcafedead/vimyac

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vimyac - HttpYac for vim/neovim

This tiny plugin just wraps the HttpYac CLI to quickly execute HTTP requests from vim.
Similar to REST Client for VSCode or HTTP Client for IntelliJ IDEA.

Requirements

Please note: as the plugin is just a wrapper for the HttpYac CLI, you need to have the latter installed on your system.
You can install it in various ways, the only requirement is that the httpyac command should be available in your PATH.
For example, you can install it using npm:

npm install -g httpyac

Installation

Just install using your favorite plugin manager.
Example for vim-plug:

Plug 'oxcafedead/vimyac'

Usage

By default, plugin provides the following commands:

  • :YacExec - Execute the request which matches the current line. Default keybinding is <leader>yr
  • :YacExecAll - Execute all requests in the current file. Default keybinding is <leader>ya

Supports everything that HttpYac supports, including variables, environments, auth schemas, etc.
If dotenv files are detected, the user will be prompted to load them. Additional arguments can be passed to the httpyac command for the flexibility, for example:

:YacExec --timeout 5000

You can get familiar with all the rich features of the awesome HttpYac tool by visiting the official documentation.

Demonstration

Demo

Limitations

  • Plugin is a wrapper for the CLI, so it doesn't provide any additional features like syntax highlighting, etc. (However, CLI arguments are auto-completed for :Yac* commands)
  • It was written in a hurry, so there might be some bugs. Also, I am a noob in Vimscript.