mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-24 17:58:38 +02:00
plugins/rest: v3 migration
This commit is contained in:
parent
78816c0c9c
commit
a75c2235d9
2 changed files with 185 additions and 216 deletions
|
@ -13,69 +13,51 @@
|
|||
enable = true;
|
||||
|
||||
settings = {
|
||||
client = "curl";
|
||||
env_file = ".env";
|
||||
env_pattern = "\\.env$";
|
||||
env_edit_command = "tabedit";
|
||||
encode_url = true;
|
||||
skip_ssl_verification = false;
|
||||
custom_dynamic_variables = { };
|
||||
logs = {
|
||||
level = "info";
|
||||
save = true;
|
||||
request = {
|
||||
skip_ssl_verification = false;
|
||||
hooks = {
|
||||
encode_url = true;
|
||||
user_agent.__raw = ''"rest.nvim v" .. require("rest-nvim.api").VERSION'';
|
||||
set_content_type = 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;
|
||||
};
|
||||
response = {
|
||||
hooks = {
|
||||
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
|
||||
'';
|
||||
format = true;
|
||||
};
|
||||
};
|
||||
clients = {
|
||||
curl = {
|
||||
statistics = [
|
||||
{
|
||||
id = "time_total";
|
||||
winbar = "take";
|
||||
title = "Time taken";
|
||||
}
|
||||
{
|
||||
id = "size_download";
|
||||
winbar = "size";
|
||||
title = "Download size";
|
||||
}
|
||||
];
|
||||
opts = {
|
||||
set_compressed = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
cookies = {
|
||||
enable = true;
|
||||
path.__raw = ''vim.fs.joinpath(vim.fn.stdpath("data") --[[@as string]], "rest-nvim.cookies")'';
|
||||
};
|
||||
env = {
|
||||
enable = true;
|
||||
pattern = ".*%.env.*";
|
||||
};
|
||||
ui = {
|
||||
winbar = true;
|
||||
keybinds = {
|
||||
buffer_local = false;
|
||||
prev = "H";
|
||||
next = "L";
|
||||
};
|
||||
|
@ -84,18 +66,7 @@
|
|||
enable = true;
|
||||
timeout = 750;
|
||||
};
|
||||
keybinds = [
|
||||
[
|
||||
"<localleader>rr"
|
||||
"<cmd>Rest run<cr>"
|
||||
"Run request under the cursor"
|
||||
]
|
||||
[
|
||||
"<localleader>rl"
|
||||
"<cmd>Rest run last<cr>"
|
||||
"Re-run latest request"
|
||||
]
|
||||
];
|
||||
_log_level.__raw = ''vim.log.levels.WARN'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue