A lightweight Neovim plugin that brings HttpYac into your editor — run REST requests, switch environments, and replay sequences without leaving the buffer.
http-client.env.json and dotenv files[!IMPORTANT] HttpYac must be installed and available on your
PATH:npm install -g httpyac
return {
"abidibo/nvim-httpyac",
config = function()
require("nvim-httpyac").setup()
end,
}
return {
"abidibo/nvim-httpyac",
config = function()
require("nvim-httpyac").setup({
output_view = "vertical", -- "vertical" | "horizontal"
})
vim.keymap.set("n", "<Leader>rr", "<cmd>NvimHttpYac<CR>", { desc = "Run request under cursor" })
vim.keymap.set("n", "<Leader>ra", "<cmd>NvimHttpYacAll<CR>", { desc = "Run all requests" })
vim.keymap.set("n", "<Leader>rp", "<cmd>NvimHttpYacPicker<CR>", { desc = "Pick a named request" })
vim.keymap.set("n", "<Leader>re", "<cmd>NvimHttpYacEnv<CR>", { desc = "Select environment" })
vim.keymap.set("n", "<Leader>rc", "<cmd>NvimHttpYacEnvClear<CR>", { desc = "Clear environment" })
vim.keymap.set("n", "<Leader>rq", "<cmd>NvimHttpYacSequence<CR>", { desc = "Toggle sequence recording" })
vim.keymap.set("n", "<Leader>rs", "<cmd>NvimHttpYacSequencePicker<CR>", { desc = "Sequence picker" })
end,
}
| Option | Type | Default | Description |
|---|---|---|---|
output_view |
string |
"vertical" |
How the response window opens. Either "vertical" or "horizontal". |
[!TIP] You don't need to save the file first — the current buffer content is what gets executed.
| Command | Description |
|---|---|
:NvimHttpYac |
Execute the request under the cursor |
:NvimHttpYacAll |
Execute all requests in the buffer |
:NvimHttpYacPicker |
Pick a named request from a list |
:NvimHttpYacEnv |
Select an environment (sticky across subsequent requests) |
:NvimHttpYacEnvClear |
Clear the active environment |
:NvimHttpYacSequence |
Toggle sequence recording; on stop, prompts for a name (ESC to discard) |
:NvimHttpYacSequencePicker |
Browse saved sequences with a Run/Delete menu |
The first three commands accept extra arguments that are forwarded to httpyac. For example:
:NvimHttpYac --env dev
:NvimHttpYacEnv auto-discovers environments by scanning for:
http-client.env.json / http-client.private.env.json (IntelliJ format — top-level keys are environment names).env.{name} and {name}.env dotenv filesFiles are searched in the current file's directory, the project root, and an env/ subfolder.
Once selected, the environment is sticky: it's appended to every subsequent request until cleared with :NvimHttpYacEnvClear or replaced by another selection. Passing --env explicitly on a command overrides the sticky environment for that one call.
:NvimHttpYacSequence toggles recording mode. While active, every named request you run via :NvimHttpYacPicker is captured. Stopping recording prompts for a sequence name — press Enter to save, ESC to discard. Unnamed requests (cursor-based or run-all) are skipped with a warning suggesting you add a # @name annotation.
Sequences are persisted to .httpyac-sequences.json in the project root. Use :NvimHttpYacSequencePicker to browse, run, or delete them.
When a sequence runs, requests execute one after another in the recorded order. Output is appended to the response buffer as each request completes. If any request fails, the sequence is aborted and an error is shown.
Inspired by and built on the shoulders of:
See LICENSE for details.