nixos/pkgsets/nvim/hurl.nix

91 lines
1.9 KiB
Nix

{
lib,
config,
pkgs,
...
}:
lib.mkIf (lib.elem "nvim::hurl" config.machine.pkgs) {
programs.nvim-lazy.lazyPlugins = [
{
lazy = true;
dir = vPlug: vPlug.nui-nvim;
}
{
lazy = true;
ft = [ "hurl" ];
short = "jellydn/hurl.nvim";
dependencies = (vPlug: with vPlug; [ nui-nvim ]);
opts = {
debug = false;
show_notification = false;
# Show response in popup or split
mode = "popup";
formatters = {
json = [ "${pkgs.jq}/bin/jq" ];
html = [
"${pkgs.nodePackages.prettier}/bin/prettier"
"--parser"
"html"
];
};
};
keys = [
{
bind = "<leader>A";
cmd = "<cmd>HurlRunner<CR>";
opts = {
ft = "hurl";
desc = "Run All requests";
};
}
{
bind = "<leader>a";
cmd = "<cmd>HurlRunnerAt<CR>";
opts = {
ft = "hurl";
desc = "Run Api request";
};
}
{
bind = "<leader>te";
cmd = "<cmd>HurlRunnerToEntry<CR>";
opts = {
ft = "hurl";
desc = "Run Api request to entry";
};
}
{
bind = "<leader>tm";
cmd = "<cmd>HurlToggleMode<CR>";
opts = {
ft = "hurl";
desc = "Hurl Toggle Mode";
};
}
{
bind = "<leader>tv";
cmd = "<cmd>HurlVerbose<CR>";
opts = {
ft = "hurl";
desc = "Run Api in verbose mode";
};
}
{
bind = "<leader>h";
cmd = ":HurlRunner<CR>";
opts = {
ft = "hurl";
desc = "Hurl Runner";
mode = "v";
};
}
];
}
{
lazy = true;
ft = [ "hurl" ];
dir = vPlug: vPlug.hurl;
}
];
}