rest-nvim / rest.nvim

A fast Neovim http client written in Lua
GNU General Public License v3.0
1.61k stars 142 forks source link

How to use with Lua keybinding in V2 #314

Closed kevintraver closed 8 months ago

kevintraver commented 8 months ago

In version 1, I was able to set up a lua keymap like this:

vim.keymap.set({ "n" }, "<C-Enter>", function()
  require("rest-nvim").run()
end, { desc = "Send HTTP Request", buffer = true })

Obviously a lot has changed in v2.

How do I set up a keymap with lua in v2?

NTBBloodbath commented 8 months ago

Hi, sorry for the delay, I was sleeping.

I would recommend you take a look at :h rest-nvim.functions. That's the Lua module those functions have been moved to.

kevintraver commented 8 months ago

This is working now:

require("rest-nvim.functions").exec("cursor")

Thanks!