From 25b06613db9fc53ab8121d8debc742cec2523c5b Mon Sep 17 00:00:00 2001 From: Thomas Ruoff Date: Thu, 8 Jan 2026 17:13:11 +0100 Subject: [PATCH] add hurl --- lua/plugins/hurl.lua | 58 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 lua/plugins/hurl.lua diff --git a/lua/plugins/hurl.lua b/lua/plugins/hurl.lua new file mode 100644 index 0000000..24790c4 --- /dev/null +++ b/lua/plugins/hurl.lua @@ -0,0 +1,58 @@ +return { + 'jellydn/hurl.nvim', + dependencies = { + 'MunifTanjim/nui.nvim', + 'nvim-lua/plenary.nvim', + 'nvim-treesitter/nvim-treesitter', + -- Optional, for markdown rendering with render-markdown.nvim + { + 'MeanderingProgrammer/render-markdown.nvim', + opts = { + file_types = { 'markdown' }, + }, + ft = { 'markdown' }, + }, + }, + ft = 'hurl', + opts = { + -- Show debugging info + debug = false, + -- Show notification on run + show_notification = false, + -- Show response in popup or split + mode = 'split', + -- Default formatter + formatters = { + json = { 'jq' }, -- Make sure you have install jq in your system, e.g: brew install jq + html = { + 'prettier', -- Make sure you have install prettier in your system, e.g: npm install -g prettier + '--parser', + 'html', + }, + xml = { + 'tidy', -- Make sure you have installed tidy in your system, e.g: brew install tidy-html5 + '-xml', + '-i', + '-q', + }, + }, + -- Default mappings for the response popup or split views + mappings = { + close = 'q', -- Close the response popup or split view + next_panel = '', -- Move to the next response popup window + prev_panel = '', -- Move to the previous response popup window + }, + }, + keys = { + -- Run API request + { 'A', 'HurlRunner', desc = 'Run All requests' }, + { 'a', 'HurlRunnerAt', desc = 'Run Api request' }, + { 'te', 'HurlRunnerToEntry', desc = 'Run Api request to entry' }, + { 'tE', 'HurlRunnerToEnd', desc = 'Run Api request from current entry to end' }, + { 'tm', 'HurlToggleMode', desc = 'Hurl Toggle Mode' }, + { 'tv', 'HurlVerbose', desc = 'Run Api in verbose mode' }, + { 'tV', 'HurlVeryVerbose', desc = 'Run Api in very verbose mode' }, + -- Run Hurl request in visual mode + { 'h', ':HurlRunner', desc = 'Hurl Runner', mode = 'v' }, + }, +}