Something went wrong. Try again.
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108---@mod rest-nvim.config.default rest.nvim default configuration
---@comment default-config:start---rest.nvim default configuration---@class rest.Configlocal default_config = { ---@type table<string, fun():string> Table of custom dynamic variables custom_dynamic_variables = {}, ---@class rest.Config.Request request = { ---@type boolean Skip SSL verification, useful for unknown certificates skip_ssl_verification = false, ---Default request hooks ---@class rest.Config.Request.Hooks hooks = { ---@type boolean Encode URL before making request encode_url = true, ---@type string Set `User-Agent` header when it is empty user_agent = "rest.nvim v" .. require("rest-nvim.api").VERSION, ---@type boolean Set `Content-Type` header when it is empty and body is provided set_content_type = true, }, }, ---@class rest.Config.Response response = { ---Default response hooks ---@class rest.Config.Response.Hooks hooks = { ---@type boolean Decode the request URL segments on response UI to improve readability decode_url = true, ---@type boolean Format the response body using `gq` command format = true, }, }, ---@class rest.Config.Clients clients = { ---@class rest.Config.Clients.Curl curl = { ---Statistics to be shown, takes cURL's `--write-out` flag variables ---See `man curl` for `--write-out` flag ---@type RestStatisticsStyle[] statistics = { { id = "time_total", winbar = "take", title = "Time taken" }, { id = "size_download", winbar = "size", title = "Download size" }, }, ---Curl-secific request/response hooks ---@class rest.Config.Clients.Curl.Opts opts = { ---@type boolean Add `--compressed` argument when `Accept-Encoding` header includes ---`gzip` set_compressed = false, ---@type table<string, Certificate> Table containing certificates for each domains certificates = {}, }, }, }, ---@class rest.Config.Cookies cookies = { ---@type boolean Whether enable cookies support or not enable = true, ---@type string Cookies file path path = vim.fs.joinpath(vim.fn.stdpath("data") --[[@as string]], "rest-nvim.cookies"), }, ---@class rest.Config.Env env = { ---@type boolean enable = true, ---@type string pattern = ".*%.env.*", ---@type fun():string[] find = function() local config = require("rest-nvim.config") return vim.fs.find(function(name, _) return name:match(config.env.pattern) end, { path = vim.fn.getcwd(), type = "file", limit = math.huge, }) end, }, ---@class rest.Config.UI ui = { ---@type boolean Whether to set winbar to result panes winbar = true, ---@class rest.Config.UI.Keybinds keybinds = { ---@type string Mapping for cycle to previous result pane prev = "H", ---@type string Mapping for cycle to next result pane next = "L", }, }, ---@class rest.Config.Highlight highlight = { ---@type boolean Whether current request highlighting is enabled or not enable = true, ---@type number Duration time of the request highlighting in milliseconds timeout = 750, }, ---@see vim.log.levels ---@type integer log level _log_level = vim.log.levels.WARN,}---@comment default-config:end
return default_config