Skip to content

Commit

Permalink
fix(rest-nvim)!: update to rest.nvim v2 (#877)
Browse files Browse the repository at this point in the history
  • Loading branch information
gearj authored Apr 12, 2024
1 parent 86a86a6 commit f1456b7
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions lua/astrocommunity/programming-language-support/rest-nvim/init.lua
Original file line number Diff line number Diff line change
@@ -1,31 +1,34 @@
return {
{
"rest-nvim/rest.nvim",
ft = { "http", "json" },
cmd = {
"RestNvim",
"RestNvimPreview",
"RestNvimLast",
},
ft = "http",
cmd = "Rest",
dependencies = {
"nvim-lua/plenary.nvim",
{
"vhyrro/luarocks.nvim",
priority = 1000,
config = true,
},
{
"AstroNvim/astrocore",
opts = function(_, opts)
local maps = opts.mappings
local prefix = "<Leader>r"
maps.n[prefix] = { desc = "RestNvim" }
maps.n[prefix .. "r"] = { "<Plug>RestNvim", desc = "Run request" }
maps.n[prefix .. "r"] = { "<cmd>Rest run<cr>", desc = "Run request under the cursor" }
maps.n[prefix .. "l"] = { "<cmd>Rest run last<cr>", desc = "Re-run latest request" }
end,
},
},
main = "rest-nvim",
opts = {},
},
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
if opts.ensure_installed ~= "all" then
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "http", "json" })
opts.ensure_installed =
require("astrocore").list_insert_unique(opts.ensure_installed, { "lua", "xml", "http", "json", "graphql" })
end
end,
},
Expand Down

0 comments on commit f1456b7

Please sign in to comment.