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

feat: custom mappings for cycle result pane #351

Closed daniilrozanov closed 7 months ago

daniilrozanov commented 7 months ago

There was added new table in result table named keybinds. With this table you can redefine mapping for cycle_result_pane action. To do this, in config you need to add

result = {
  keybinds = {
    prev = "J", -- or any
    next = "K", -- or any
  }
}

Other feature is ability to choose does these mappings attach to request result buffer or not. If you want to make mappings locally in buffer, add

result = {
  keybinds = {
    -- ...
    buffer_local = true
  }
}

This feature is useful if you already have other actions mapped with H or L.

Defaults for result.keybinds are following:

keybinds = {
  buffer_local = false,
  prev = "H",
  next = "L",
}

So plugin acts like before if keybinds is not set.

countcain commented 7 months ago

thank you so much!