A fast Neovim http client written in Lua.
rest.nvim
makes use of a curl wrapper made in pure Lua by tami5 and implemented
in plenary.nvim
so, in other words, rest.nvim
is a curl wrapper so you don't
have to leave Neovim!
IMPORTANT: If you are facing issues, please report them
- 2021-07-01: Now for getting syntax highlighting in http files you should
add a
require('rest-nvim').setup()
to yourrest.nvim
setup, refer to packer.nvim. This breaking change should allow lazy-loading ofrest.nvim
.
- Easy to use
- Fast execution time
- Run request under cursor
- Syntax highlight for http files and output
- Possibility of using environment variables in http files
WARNING: rest.nvim requires Neovim >= 0.5 to work.
- System-wide
- curl
- jq (to format JSON output so it can be human-readable)
- Other plugins
use {
'NTBBloodbath/rest.nvim',
requires = { 'nvim-lua/plenary.nvim' },
config = function()
require("rest-nvim").setup({
-- Open request results in a horizontal split
result_split_horizontal = false,
-- Skip SSL verification, useful for unknown certificates
skip_ssl_verification = false,
})
end
}
By default rest.nvim
does not have any key mappings so you will not have
conflicts with any of your existing ones.
To run rest.nvim
you should map the following commands:
<Plug>RestNvim
, run the request under the cursor<Plug>RestNvimPreview
, preview the request cURL command<Plug>RestNvimLast
, re-run the last request
result_split_horizontal
opens result on a horizontal split (default opens on vertical)skip_ssl_verification
passes the-k
flag to cURL in order to skip SSL verification, useful when using unknown certificates
Create a new http file or open an existing one and place the cursor over the
request method (e.g. GET
) and run rest.nvim
.
NOTES:
rest.nvim
follows the RFC 2616 request format so any other http file should work without problems.You can find examples of use in tests
- Fork it (https://github.com/NTBBloodbath/rest.nvim/fork)
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
rest.nvim is MIT Licensed.