From 7dc87763b9f2645f4f0fc820932e8cd76ade8410 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20La=C3=ADn?= Date: Tue, 3 Sep 2024 11:55:49 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9A=99=EF=B8=8F=20config(nvim):=20use=20rest?= =?UTF-8?q?-client=20included=20in=20lazyvim=20instead=20of=20custom=20one?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lua/plugins/extras/editor/rest-client.lua | 70 ------------------- .../lua/plugins/extras/util/rest-extended.lua | 16 +++++ 2 files changed, 16 insertions(+), 70 deletions(-) delete mode 100644 .config/nvim/lua/plugins/extras/editor/rest-client.lua create mode 100644 .config/nvim/lua/plugins/extras/util/rest-extended.lua diff --git a/.config/nvim/lua/plugins/extras/editor/rest-client.lua b/.config/nvim/lua/plugins/extras/editor/rest-client.lua deleted file mode 100644 index 2475eb74..00000000 --- a/.config/nvim/lua/plugins/extras/editor/rest-client.lua +++ /dev/null @@ -1,70 +0,0 @@ -local prefix = "th" - -return { - { - "nvim-treesitter/nvim-treesitter", - opts = function(_, opts) - if type(opts.ensure_installed) == "table" then - vim.list_extend(opts.ensure_installed, { "http" }) - end - end, - }, - { - "rest-nvim/rest.nvim", - ft = "http", - opts = { - -- Open request results in a horizontal split - result_split_horizontal = true, - -- Keep the http file buffer above|left when split horizontal|vertical - result_split_in_place = false, - -- Skip SSL verification, useful for unknown certificates - skip_ssl_verification = false, - -- Encode URL before making request - encode_url = true, - -- Highlight request on run - highlight = { - enabled = true, - timeout = 150, - }, - result = { - -- toggle showing URL, HTTP info, headers at top the of result window - show_url = true, - show_http_info = true, - show_headers = true, - -- executables or functions for formatting response body [optional] - -- set them to false if you want to disable them - formatters = { - json = "jq", - html = function(body) - return vim.fn.system({ "tidy", "-i", "-q", "-" }, body) - end, - }, - }, - -- Jump to request line on run - jump_to_request = false, - env_file = ".env", - custom_dynamic_variables = {}, - yank_dry_run = true, - }, - config = function(_, opts) - require("rest-nvim").setup(opts) - LazyVim.on_load("telescope.nvim", function() - require("telescope").load_extension("rest") - end) - end, - -- stylua: ignore - keys = { - { prefix .. "p", function() require("rest-nvim").run(true) end, desc = "Preview Request" }, - { prefix .. "r", function() require("rest-nvim").run() end, desc = "Run Request" }, - { "sv", function() require("telescope").extensions.rest.select_env() end, desc = "Env Files" }, - }, - }, - { - "folke/which-key.nvim", - opts = { - spec = { - { prefix, group = "http", icon = "󱞒 " }, - }, - }, - }, -} diff --git a/.config/nvim/lua/plugins/extras/util/rest-extended.lua b/.config/nvim/lua/plugins/extras/util/rest-extended.lua new file mode 100644 index 00000000..a020602f --- /dev/null +++ b/.config/nvim/lua/plugins/extras/util/rest-extended.lua @@ -0,0 +1,16 @@ +return { + { import = "lazyvim.plugins.extras.util.rest" }, + { + "mistweaverco/kulala.nvim", + opts = { + icons = { + inlay = { + loading = "󰔟", + done = " ", + error = " ", + }, + lualine = " ", + }, + }, + }, +}