Requirements • Install • Usage • HTTP File Spec
A minimal REST-Client Interface for Neovim.
Kulala is swahili for "rest" or "relax".
It allows you to make HTTP requests from within Neovim.
- Neovim (tested with 0.10.0)
- Treesitter for HTTP (
:TSInstall http
)
- Treesitter for HTTP (
- cURL (tested with 8.5.0)
- jq (tested with 1.7) (Only required for formatted JSON responses)
- xmllint (tested with libxml v20914) (Only required for formatted XML/HTML responses)
To make things a lot easier, you can put this lua snippet somewhere in your configuration:
vim.filetype.add({
extension = {
['http'] = 'http',
},
})
This will make Neovim recognize files
with the .http
extension as HTTP files.
Via lazy.nvim:
require('lazy').setup({
-- HTTP REST-Client Interface
{
'mistweaverco/kulala.nvim'
config = function()
require('kulala').setup({
debug = false, -- Enable debug mode
default_view = 'body', -- body or headers
})
end
},
})
Run the current request.
Toggles between the body
and headers
view of the last run request.
Persists across restarts.
Jump to the previous request.
Jump to the next request.
The syntax highlighting for HTTP files on GitHub is not perfect.
It shows errors where there are none.
examples.http
# Make a request to the PokeAPI to get information about ditto
# Use HTTP/1.0 and the application/json content type as headers
GET https://pokeapi.co/api/v2/pokemon/ditto HTTP/1.0
accept: application/json
###
# Make a request to the Star Wars API to get information about all films
# Use a GraphQL query to get the title and episodeID of each film
# Use the application/json content type as the header and omit the HTTP version
# so it defaults to HTTP/1.1
GET https://swapi-graphql.netlify.app/.netlify/functions/index
accept: application/json
< ./starwars.graphql
###
POST https://swapi-graphql.netlify.app/.netlify/functions/index
accept: application/json
content-type: application/json
{
"query": "{ allFilms { films { title } } }",
"variables": {}
}
###
starwars.graphql
query {
allFilms {
films {
title
episodeID
}
}
}
Place the cursor on any item
in the examples.http
and
run :lua require('kulala').run()
.