jakewvincent/mkdnflow.nvim

Feature: Assign multiple bindings to a single command, depending on mode

diegovskytl opened this issue · 0 comments

It would be neat to be able to assigne two or three bindings to a single command, depending on neovim's mode; my attemped config is stated below, but the binding ends up disabled completely.
Obviosuly, writing the binding in separate lines makes that only the last one is read.

    mappings = {
        MkdnFoldSection = { "n", "<M-f>" },
-- something like this
        MkdnToggleToDo = { { "i", "n" }, { "<M-ñ>", "ñ" } },
        MkdnTab = { "i", "<Tab>" },
    },

Also tried to implement a buffer-only keymap using on_attach but it did not work:

  on_attach = function(bufnr)
       local map = vim.keymap.set
      local opts = { buffer = bufnr }
      map("n", "<M-l>", "<Esc>I<Tab><Esc>A<Esc>", opts)
      map("n", "<M-h>", "<Esc>I<BS><Esc>A<Esc>", opts)
  end,