Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better keymap config #15

Open
hedyhli opened this issue Nov 12, 2023 · 3 comments
Open

Better keymap config #15

hedyhli opened this issue Nov 12, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@hedyhli
Copy link
Owner

hedyhli commented Nov 12, 2023

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 hedyhli added this to the v1.0.0 milestone Nov 12, 2023
@hedyhli hedyhli added the enhancement New feature or request label Nov 12, 2023
@hedyhli hedyhli removed this from the v1.0.0 milestone Nov 16, 2023
@oredaze
Copy link

oredaze commented Jan 7, 2024

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
Copy link

Ajaymamtora commented Mar 27, 2024

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
Copy link
Owner Author

hedyhli commented Mar 28, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants