outline.nvim icon indicating copy to clipboard operation
outline.nvim copied to clipboard

Better keymap config

Open hedyhli opened this issue 8 months ago • 3 comments

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.

hedyhli avatar Nov 12 '23 08:11 hedyhli

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.

oredaze avatar Jan 07 '24 16:01 oredaze

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,
    },
  },

Ajaymamtora avatar Mar 27 '24 22:03 Ajaymamtora

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

hedyhli avatar Mar 28 '24 00:03 hedyhli