From 2f09ab84a13e114b8a1585b55ba62e8d31c59370 Mon Sep 17 00:00:00 2001 From: Ariel D'Alessandro Date: Tue, 12 Apr 2022 20:10:58 +0200 Subject: Add new plugin for http not blocking --- after/plugin/rest.lua | 37 +++++++++++++++++++++++++++++++++++++ lua/alpha/dap.lua | 2 ++ lua/alpha/plugins.lua | 6 +++++- 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 after/plugin/rest.lua diff --git a/after/plugin/rest.lua b/after/plugin/rest.lua new file mode 100644 index 0000000..baf4edd --- /dev/null +++ b/after/plugin/rest.lua @@ -0,0 +1,37 @@ +local ok, rest_nvim = pcall(require, "rest-nvim") +if not ok then + return +end + +rest_nvim.setup({ + -- Open request results in a horizontal split + result_split_horizontal = false, + -- Skip SSL verification, useful for unknown certificates + skip_ssl_verification = false, + -- 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, + }, + -- Jump to request line on run + jump_to_request = false, + env_file = ".env", + custom_dynamic_variables = {}, + yank_dry_run = true, +}) + +vim.api.nvim_create_autocmd("FileType", { + pattern = "http", + callback = function () + local buff = tonumber(vim.fn.expand(""), 10) + vim.keymap.set("n", "rn", rest_nvim.run, { noremap = true, buffer = buff }) + vim.keymap.set("n", "rl", rest_nvim.last, { noremap = true, buffer = buff }) + end +}) + diff --git a/lua/alpha/dap.lua b/lua/alpha/dap.lua index e0058e0..27b596d 100644 --- a/lua/alpha/dap.lua +++ b/lua/alpha/dap.lua @@ -10,6 +10,8 @@ dapui.setup({ require("dap-go").setup() +vim.fn.sign_define("DapBreakpoint", { text = "ß", texthl = "", linehl = "", numhl = "" }) + dap_install.config("php", { configurations = { { diff --git a/lua/alpha/plugins.lua b/lua/alpha/plugins.lua index 3b16980..042791f 100644 --- a/lua/alpha/plugins.lua +++ b/lua/alpha/plugins.lua @@ -190,7 +190,11 @@ return require("packer").startup(function(use) }, }) - use({ "nicwest/vim-http", opt = true, cmd = { "Http" } }) + use({ + "NTBBloodbath/rest.nvim", + requires = { "nvim-lua/plenary.nvim" }, + }) + use({ "vimwiki/vimwiki", opt = true, cmd = { "VimwikiIndex" } }) -- Local plugins can be included -- cgit v1.2.3