mirror of
https://github.com/macocianradu/nvim-http.git
synced 2026-07-16 02:48:46 +00:00
18 lines
556 B
Lua
18 lines
556 B
Lua
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()
|
|
end, {
|
|
desc = "Run HTTP command under cursor and open Telescope response tree",
|
|
})
|
|
|
|
-- Set up keybinding
|
|
vim.keymap.set('n', '<leader>hr', function()
|
|
nvim_http.run_http_under_cursor()
|
|
end, { desc = "Run HTTP under cursor" })
|