Skip to content

Commit 1fed87b

Browse files
iamralchUzaaft
andauthored
feat(pack): Add hurl pack (#1486)
* feat(hurl-nvim): add new plugin for Hurl support in Neovim Introduce hurl.nvim, a fast Neovim client for Hurl written in Lua. Includes key mappings, dependencies, and configuration for seamless integration. Signed-off-by: Svetlin Ralchev <svetlin@ralch.com> * Update lua/astrocommunity/programming-language-support/hurl-nvim/README.md * Update lua/astrocommunity/programming-language-support/hurl-nvim/init.lua * fix: Add `hurl` to `ensured_installed` * feat(hurl.nvim): remove redundant config function The `config` function was removed as it was redundant. The setup logic for `hurl.nvim` is now simplified, reducing unnecessary complexity. Signed-off-by: Svetlin Ralchev <svetlin@ralch.com> * refactor: move to a pack --------- Signed-off-by: Svetlin Ralchev <svetlin@ralch.com> Co-authored-by: Uzair Aftab <48220549+Uzaaft@users.noreply.github.com> Co-authored-by: Uzair Aftab <uzaaft@outlook.com>
1 parent 44d5c7f commit 1fed87b

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Hurl pack
2+
3+
**Requirements**: `hurl` must be in your `PATH` ane executable.
4+
5+
This pack does the following:
6+
7+
- Adds [Hurl.nvim](https://github.com/jellydn/hurl.nvim), a Neovim plugin designed to run HTTP requests directly from `.hurl` files.
8+
9+

lua/astrocommunity/pack/hurl/init.lua

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
local prefix = "<Leader>H"
2+
3+
return {
4+
"jellydn/hurl.nvim",
5+
ft = "hurl",
6+
dependencies = {
7+
"MunifTanjim/nui.nvim",
8+
"nvim-lua/plenary.nvim",
9+
{
10+
"nvim-treesitter/nvim-treesitter",
11+
opts = function(_, opts)
12+
if opts.ensure_installed ~= "all" then
13+
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "hurl" })
14+
end
15+
end,
16+
},
17+
{
18+
"WhoIsSethDaniel/mason-tool-installer.nvim",
19+
optional = true,
20+
opts = function(_, opts)
21+
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "jq", "prettier" })
22+
end,
23+
},
24+
},
25+
specs = {
26+
{
27+
"AstroNvim/astroui",
28+
---@type AstroUIOpts
29+
opts = { icons = { HurlNvim = "" } },
30+
},
31+
{
32+
"AstroNvim/astrocore",
33+
opts = function(_, opts)
34+
local maps = opts.mappings
35+
maps.n[prefix] = { desc = require("astroui").get_icon("HurlNvim", 1, true) .. "HurlNvim" }
36+
maps.n[prefix .. "R"] = { "<cmd>HurlRunner<cr>", desc = "Run all requests in the file" }
37+
maps.n[prefix .. "r"] = { "<cmd>HurlRunnerAt<cr>", desc = "Run request under the cursor" }
38+
maps.n[prefix .. "e"] = { "<cmd>HurlRunnerToEntry<cr>", desc = "Run request to the entry" }
39+
maps.n[prefix .. "E"] = { "<cmd>HurlRunnerToEnd<cr>", desc = "Run all request to the end" }
40+
maps.n[prefix .. "v"] = { "<cmd>HurlVerbose<cr>", desc = "Toggle verbose mode" }
41+
maps.n[prefix .. "V"] = { "<cmd>HurlVeryVerbose<cr>", desc = "Toggle very verbose mode" }
42+
end,
43+
},
44+
},
45+
opts = {},
46+
}

0 commit comments

Comments
 (0)