nix-community.nixvim/tests/test-sources/plugins/utils/rest.nix

98 lines
2.4 KiB
Nix
Raw Normal View History

2024-01-21 15:34:18 +01:00
{
empty = {
plugins.rest.enable = true;
};
defaults = {
plugins.rest = {
enable = true;
2024-04-07 14:07:31 +02:00
settings = {
client = "curl";
env_file = ".env";
env_pattern = "\\.env$";
env_edit_command = "tabedit";
encode_url = true;
skip_ssl_verification = false;
2024-05-05 19:39:35 +02:00
custom_dynamic_variables = { };
2024-04-07 14:07:31 +02:00
logs = {
level = "info";
save = true;
};
result = {
split = {
horizontal = false;
in_place = false;
stay_in_current_window_after_split = true;
};
behavior = {
show_info = {
url = true;
headers = true;
http_info = true;
curl_command = true;
};
decode_url = true;
statistics = {
enable = true;
stats = [
{
__unkeyed = "total_time";
title = "Time taken:";
}
{
__unkeyed = "size_download_t";
title = "Download size:";
}
];
};
formatters = {
json = "jq";
html.__raw = ''
function(body)
if vim.fn.executable("tidy") == 0 then
return body, { found = false, name = "tidy" }
end
local fmt_body = vim.fn.system({
"tidy",
"-i",
"-q",
"--tidy-mark", "no",
"--show-body-only", "auto",
"--show-errors", "0",
"--show-warnings", "0",
"-",
}, body):gsub("\n$", "")
return fmt_body, { found = true, name = "tidy" }
end
'';
};
};
2024-04-07 14:07:31 +02:00
keybinds = {
buffer_local = false;
prev = "H";
next = "L";
};
2024-04-07 14:07:31 +02:00
};
highlight = {
enable = true;
timeout = 750;
2024-01-21 15:34:18 +01:00
};
2024-04-07 14:07:31 +02:00
keybinds = [
[
"<localleader>rr"
"<cmd>Rest run<cr>"
"Run request under the cursor"
]
[
"<localleader>rl"
"<cmd>Rest run last<cr>"
"Re-run latest request"
]
];
2024-01-21 15:34:18 +01:00
};
};
};
}