hedyhli / outline.nvim

Code outline sidebar powered by LSP. Significantly enhanced & refactored fork of symbols-outline.nvim.
https://sr.ht/~hedy/outline.nvim
MIT License
569 stars 17 forks source link

Better keymap config #15

Open hedyhli opened 10 months ago

hedyhli commented 10 months ago

I will be adding "mapping" key that introduces a new style of config for keymaps, similar to how it's done in nvim-cmp.

Rather than having the actions as keys and key sequence as value, we will have the other way around. this makes it easier to disable keymaps as well as letting user customize keymaps to use their own functions

The existing keymap will be supported due to the major breaking change if it were otherwise. the config module will handle converting keymaps table to new mappings table, if the user provided them

mappings = {
  ["<tab>"] = "fold toggle"
}

Not sure on the specifics of what should be used on the RHS. Maybe if rhs is a string, it is considered a default action. rhs could also be a function.

oredaze commented 8 months ago

I hope this will add the ability to use nowait = true on my spacebar, which I cannot bind now, because it's the prefix key for many things.

Ajaymamtora commented 5 months ago

How do I disable a key binding I cant figure it out? Tried setting close to "", {}, nil, {""}, {nil}, am i missing something?

opts = {
    keymaps = {
      close = nil,
    },
    symbol_folding = {
      autofold_depth = 1,
      auto_unfold = {
        hovered = true,
      },
    },
    -- preview_window = {
    --   auto_preview = true,
    -- },
    outline_window = {
      auto_jump = true,
      wrap = true,
    },
    outline_items = {
      show_symbol_lineno = true,
    },
  },
hedyhli commented 5 months ago

Hi @Ajaymamtora, it says on in the docs that you can set to {} to disable. Please do try again, and open a separate issue if it still doesn't work.

https://github.com/hedyhli/outline.nvim?tab=readme-ov-file#default-options