A Neovim plugin for running HTTP requests directly from .http files, with support for environment variables. Inspired by the IntelliJ HTTP Client, this plugin brings similar functionality to Neovim in an easy-to-install and easy-to-use package.
The core goal is to ensure compatibility with .http files from IntelliJ or VSCode, allowing them to run smoothly in Neovim and vice-versa.
Development is ongoing, with new features added as needed or when time permits.
This plugin is designed to be installed with Lazy.nvim.
Copy this complete configuration into your Lazy.nvim setup:
{
"heilgar/nvim-http-client",
dependencies = {
"nvim-lua/plenary.nvim",
"hrsh7th/nvim-cmp", -- Optional but recommended for enhanced autocompletion
"nvim-telescope/telescope.nvim", -- Optional for better environment selection
},
event = "VeryLazy",
ft = { "http", "rest" },
config = function()
require("http_client").setup({
-- Default configuration (works out of the box)
default_env_file = '.env.json',
request_timeout = 30000,
split_direction = "right",
create_keybindings = true,
-- Profiling (timing metrics for requests)
profiling = {
enabled = true,
show_in_response = true,
detailed_metrics = true,
},
-- Default keybindings (can be customized)
keybindings = {
select_env_file = "<leader>hf",
set_env = "<leader>he",
run_request = "<leader>hr",
stop_request = "<leader>hx",
toggle_verbose = "<leader>hv",
toggle_profiling = "<leader>hp",
dry_run = "<leader>hd",
copy_curl = "<leader>hc",
save_response = "<leader>hs",
},
})
-- Set up Telescope integration if available
if pcall(require, "telescope") then
require("telescope").load_extension("http_client")
end
end
}
Note about Autocompletion: If you have nvim-cmp installed, HTTP-specific autocompletion sources are automatically registered and configured for
.http
and.rest
files. You don't need any additional configuration! The plugin provides completion for HTTP methods, headers, environment variables, and content types out of the box.
For full configuration options, see Configuration Documentation.
.http
file with your HTTP requests..env.json
file with your environments.:HttpEnvFile
: Select an environment file (.env.json) to use:HttpEnv
: Select an environment from the current environment file:HttpRun
: Run the HTTP request under the cursor:HttpRunAll
: Run all HTTP requests in the current file:HttpStop
: Stop the currently running HTTP request:HttpVerbose
: Toggle verbose mode for debugging:HttpProfiling
: Toggle request profiling:HttpDryRun
: Perform a dry run of the request under the cursor:HttpCopyCurl
: Copy the curl command for the HTTP request under the cursor:HttpSaveResponse
: Save the response body to a fileThe plugin comes with the following default keybindings (if create_keybindings
is set to true
):
<leader>hf
: Select environment file<leader>he
: Set current environment<leader>hr
: Run HTTP request under cursor<leader>hx
: Stop running HTTP request<leader>hv
: Toggle verbose mode<leader>hp
: Toggle request profiling<leader>hd
: Perform dry run<leader>hc
: Copy curl command<leader>hs
: Save response to fileBelow is a comparison between this plugin and JetBrains HTTP Client, showing what's already implemented and what's planned for future releases:
Feature | Status | Notes |
---|---|---|
Basic HTTP requests | ✅ | All HTTP methods, headers, body |
Environment variables | ✅ | Including private env files |
Response formatting | ✅ | JSON, XML with syntax highlighting |
Post-request scripts | ✅ | Response handlers with > {% ... %} syntax |
Variable autocompletion | ✅ | Environment variables, headers, methods |
Request profiling | ✅ | Detailed timing metrics |
Response history | ✅ | Last 10 responses preserved |
Dry run & curl export | ✅ | Preview requests before sending |
Custom SSL certificate handling | ✅ | Self-signed certificate support |
Request chaining | ⚠️ | Basic support via global variables |
Authentication helpers | ⚠️ | Basic support through headers |
Response headers folding | ⚠️ | Basic support via Neovim folds |
Cookie management | ❌ | Planned |
Pre-request scripts | ❌ | High priority - planned |
File upload handling | ❌ | High priority - planned |
GraphQL support | ❌ | Planned |
Redirects configuration | ❌ | Planned |
WebSocket/gRPC support | ❌ | Planned |
Response schema validation | ❌ | Planned |
Response diff comparison | ❌ | Planned |
Request collections | ❌ | Planned |
Generated client code | ❌ | Planned |
Response testing/assertions | ❌ | Planned |
Proxy configuration | ❌ | Planned |
Request rate limiting | ❌ | Planned |
Batch request processing | ❌ | Planned |
Request signing (AWS, etc.) | ❌ | Planned |
OpenAPI/Swagger integration | ❌ | Multiple features planned: |
- Direct execution from Swagger files | ❌ | High priority - Run requests directly from .yaml/.json OpenAPI files |
- Import from OpenAPI specs | ❌ | Generate .http files from spec definitions |
- Generate OpenAPI specs | ❌ | Create specs from existing requests |
- API documentation viewer | ❌ | Visualize API documentation within Neovim |
Postman compatibility | ❌ | Multiple features planned: |
- Direct execution from Postman files | ❌ | Run requests directly from Postman collection files |
- Import Postman collections | ❌ | Convert Postman requests to .http format |
- Import Postman environments | ❌ | Convert to .env.json format |
- Export to Postman format | ❌ | For sharing with Postman users |
Legend:
For detailed documentation on specific features, see:
You can also access the plugin's help documentation by running :h http_client
in Neovim.
This screenshot shows the dry run feature, which allows you to preview the HTTP request before sending it.
This image demonstrates the environment selection within a chosen .env.json file, allowing you to switch between different configurations.
This screenshot displays how HTTP responses are presented after executing a request.
Contributions are welcome! Please feel free to submit a Pull Request.
CHANGELOG.md
file with your changes.This project is licensed under the MIT License. See the LICENSE file for details.