return { { "rest-nvim/rest.nvim", event = "VeryLazy", dependencies = { "nvim-lua/plenary.nvim", "nvim-neotest/nvim-nio", }, build = ":UpdateRemotePlugins", config = function() require("rest-nvim").setup({ -- Open request results in a horizontal split split = { horizontal = false, -- split horizontally width = 0.4, -- split width, number represents percentage of screen }, -- Skip SSL verification skip_ssl_verification = false, -- Encode URL characters encode_url = true, -- Highlight response highlight = { enabled = true, timeout = 200, }, -- Dynamic URL variable interpolation dynamic_variables = {}, -- Default headers default_headers = { ["Content-Type"] = "application/json", }, -- Custom curl arguments curl_args = { ["--max-time"] = 30, }, -- Format response body using gq command response = { hooks = { format = true, }, }, }) -- Set formatprg for JSON formatting vim.api.nvim_create_autocmd({ "FileType" }, { pattern = "json", callback = function(args) vim.bo[args.buf].formatprg = "jq --indent 4" end, }) end, keys = { { "rr", ":Rest run", desc = "Run HTTP request", }, { "rl", ":Rest last", desc = "Run HTTP request (last)", }, }, }, }