mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-22 08:53:31 +02:00
enc: add simplify config
This commit is contained in:
parent
8c91594e60
commit
2839d4106b
1 changed files with 8 additions and 13 deletions
|
@ -1,11 +1,3 @@
|
||||||
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 = {}
|
local M = {}
|
||||||
if pcode.rest_client then
|
if pcode.rest_client then
|
||||||
M = {
|
M = {
|
||||||
|
@ -16,13 +8,16 @@ if pcode.rest_client then
|
||||||
"nvim-lua/plenary.nvim",
|
"nvim-lua/plenary.nvim",
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
local rest_nvim = require("rest-nvim")
|
require("rest-nvim").setup()
|
||||||
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,
|
end,
|
||||||
ft = "http",
|
ft = "http",
|
||||||
|
keys = function()
|
||||||
|
local rest_nvim = require("rest-nvim")
|
||||||
|
return {
|
||||||
|
{ "<Leader>rh", rest_nvim.run, desc = "Run http request under cursor" },
|
||||||
|
{ "<Leader>rH", rest_nvim.last, desc = "Run last http request" },
|
||||||
|
}
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
return M
|
return M
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue