Added input parsing, and curl response parsing

This commit is contained in:
Radu Macocian (admac)
2026-03-19 17:01:27 +01:00
parent 7f7b38e394
commit 6a94044727
5 changed files with 49 additions and 30 deletions
+6 -6
View File
@@ -1,7 +1,9 @@
local ok, nvim_http = pcall(require, "nvim_http")
if not ok then
vim.notify("Failed to load nvim_http: " .. tostring(nvim_http), vim.log.levels.ERROR)
return
end
vim.notify("nvim_http loaded successfully", vim.log.levels.INFO)
vim.api.nvim_create_user_command("NvimHttpRun", function()
nvim_http.run_http_under_cursor()
@@ -9,9 +11,7 @@ end, {
desc = "Run HTTP command under cursor and open Telescope response tree",
})
vim.api.nvim_create_user_command("NvimHttpClear", function()
nvim_http.clear_http_result()
end, {
desc = "Close and clear HTTP response tree",
})
-- Set up keybinding
vim.keymap.set('n', '<leader>hr', function()
nvim_http.run_http_under_cursor()
end, { desc = "Run HTTP under cursor" })