mirror of
https://github.com/macocianradu/nvim-http.git
synced 2026-07-16 02:48:46 +00:00
Added input parsing, and curl response parsing
This commit is contained in:
@@ -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" })
|
||||
|
||||
Reference in New Issue
Block a user