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

feature: Disable which-key UI #548

Closed
1 task done
s1n7ax opened this issue Nov 26, 2023 · 3 comments
Closed
1 task done

feature: Disable which-key UI #548

s1n7ax opened this issue Nov 26, 2023 · 3 comments
Labels
enhancement New feature or request stale

Comments

@s1n7ax
Copy link

s1n7ax commented Nov 26, 2023

Did you check the docs?

  • I have read all the which-key.nvim docs

Is your feature request related to a problem? Please describe.

I do Youtube videos and in videos which-key popup looks like screen flicker when keymaps are executed fast. Such as dhf I use to delete inside function. When timeoutlen is set to a long time like 3000ms and press d it wait's 3000ms to show up but If I do dh popup shows up immediately.

vim.o.timeout = true
vim.o.timeoutlen = 3000

I obviously want all the keymaps to be added through which-key. However, I want to temporary disable the UI popup.

Describe the solution you'd like

A WhichKeyDisableUI WhichKeyEnableUI & WhichKeyToggleEnableUI commands to enable disable UI

Describe alternatives you've considered

Could not find a way to disable UI.

Additional context

This is how the keymaps has been registered through lazy.nvim

return {
  'nvim-treesitter/nvim-treesitter',
  opts = {
    textobjects = {
      select = {
        enable = true,
        lookahead = true,
        keymaps = {
          ['ak'] = { query = '@block.outer', desc = 'around block' },
          ['hk'] = { query = '@block.inner', desc = 'inside block' },
          ['ac'] = { query = '@class.outer', desc = 'around class' },
          ['hc'] = { query = '@class.inner', desc = 'inside class' },
          ['a?'] = {
            query = '@conditional.outer',
            desc = 'around conditional',
          },
          ['h?'] = {
            query = '@conditional.inner',
            desc = 'inside conditional',
          },
          ['af'] = {
            query = '@function.outer',
            desc = 'around function ',
          },
          ['hf'] = {
            query = '@function.inner',
            desc = 'inside function ',
          },
          ['al'] = { query = '@loop.outer', desc = 'around loop' },
          ['hl'] = { query = '@loop.inner', desc = 'inside loop' },
          ['aa'] = {
            query = '@parameter.outer',
            desc = 'around argument',
          },
          ['ha'] = {
            query = '@parameter.inner',
            desc = 'inside argument',
          },
        },
      },
    },
  },
}
@s1n7ax s1n7ax added the enhancement New feature or request label Nov 26, 2023
@realbogart
Copy link

+1

I just found this issue while trying to find a way to toggle the UI. The plugin is really helpful when I need it, but distracting when it pops up accidentally. I would like to explicitly toggle it on when I need it.

Thanks for a great plugin!

@dvalnn
Copy link

dvalnn commented Jan 29, 2024

+1
I have also struggled with this. When i cannot remember a particular key combination this plugin is amazing, however most of the time i do not have the need for it to show up and i find that just setting up a bigger timeout delay is not the optimal solution.

Great plugin either way!

Copy link
Contributor

github-actions bot commented Jul 6, 2024

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the stale label Jul 6, 2024
@folke folke closed this as completed Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale
Projects
None yet
Development

No branches or pull requests

4 participants