mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-22 00:49:01 +02:00
enc: add config rest client
This commit is contained in:
parent
61b4120e30
commit
8c91594e60
4 changed files with 95 additions and 11 deletions
28
lua/plugins/rest-nvim.lua
Normal file
28
lua/plugins/rest-nvim.lua
Normal file
|
@ -0,0 +1,28 @@
|
|||
local map_opts = { silent = true, noremap = true }
|
||||
local merge = function(tableA, tableB, ...)
|
||||
return vim.tbl_deep_extend("force", tableA, tableB, ...)
|
||||
end
|
||||
local nmap = function(lhs, rhs, opts)
|
||||
opts = opts or {}
|
||||
vim.keymap.set("n", lhs, rhs, merge(map_opts, opts))
|
||||
end
|
||||
local M = {}
|
||||
if pcode.rest_client then
|
||||
M = {
|
||||
"rest-nvim/rest.nvim",
|
||||
-- NOTE: Follow https://github.com/rest-nvim/rest.nvim/issues/306
|
||||
commit = "91badd46c60df6bd9800c809056af2d80d33da4c",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
},
|
||||
config = function()
|
||||
local rest_nvim = require("rest-nvim")
|
||||
rest_nvim.setup()
|
||||
|
||||
nmap("<Leader>rh", rest_nvim.run, { desc = "Run http request under cursor" })
|
||||
nmap("<Leader>rH", rest_nvim.last, { desc = "Run last http request" })
|
||||
end,
|
||||
ft = "http",
|
||||
}
|
||||
end
|
||||
return M
|
Loading…
Add table
Add a link
Reference in a new issue