folke / which-key.nvim

šŸ’„ Create key bindings that stick. WhichKey helps you remember your Neovim keymaps, by showing available keybindings in a popup as you type.
Apache License 2.0
5.12k stars 163 forks source link

bug: unable to disable all icons #799

Open Crypto-Spartan opened 1 month ago

Crypto-Spartan commented 1 month ago

Did you check docs and existing issues?

Neovim version (nvim -v)

0.10.0

Operating system/version

Ubuntu 22.04.4

Describe the bug

setting opts.icons.mappings = false doesn't work to disable icons. Notably, I get the standard 'box with ?' inside next to the close & back at the bottom of the which-key window as well as another icon in the bottom left-hand corner of the which-key window.

Steps To Reproduce

My which-key lazy config:

return {
    'folke/which-key.nvim',
    event = 'VeryLazy',
    keys = {
        {
            '<leader>?',
            function()
                require('which-key').show({ global = false })
            end,
            desc = 'Buffer Local Keymaps'
        },
    },
    opts = {
        icons = {
            mappings = false,
        },
    },
    init = function()
        vim.o.timeout = true
        vim.o.timeoutlen = 300
    end,
}

I also tried setting opts.icons.rules = false but that didn't fix it either.

Expected Behavior

I would like to disable all icons in Which-Key. I am unable to use nerd-fonts in my work environment.

Health

No response

Log

No response

Repro

vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()

require("lazy.minit").repro({
  spec = {
    { "folke/which-key.nvim", opts = {} },
    -- add any other plugins here
  },
})
yavorski commented 1 month ago

Set both to false

opts = {
  icons = {
    rules = false,
    mappings = false,
  },
}
Crypto-Spartan commented 1 month ago

I also tried settingĀ opts.icons.rules = falseĀ but that didn't fix it either.

Apologies, I guess I should've been more specific. I tried with each option independently, but also tried with both, this bug still exists, at least for me

max397574 commented 1 month ago

the options you tried to use aren't meant to disable all icons in the ui they just disable the icons in the mapping hints

vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()

require("lazy.minit").repro({
    spec = {
        {
            "folke/which-key.nvim",
            opts = {
                icons = {
                    mappings = false,
                    rules = false,
                    breadcrumb = ">",
                    separator = ">",
                    ellipsis = ".",
                    keys = {
                        Up = "^ ",
                        Down = "v ",
                        Left = "< ",
                        Right = "> ",
                        C = "^-",
                        M = "m-",
                        D = "dd",
                        S = "s-",
                        CR = "cr",
                        Esc = "esc ",
                        ScrollWheelDown = "v",
                        ScrollWheelUp = "^ ",
                        NL = "nl",
                        BS = "bs",
                        Space = "_",
                        Tab = ">>",
                        F1 = "f1",
                        F2 = "f2",
                        F3 = "f3",
                        F4 = "f4",
                        F5 = "f5",
                        F6 = "f6",
                        F7 = "f7",
                        F8 = "f8",
                        F9 = "f9",
                        F10 = "f10",
                        F11 = "f11",
                        F12 = "f12",
                    },
                },
            },
        },
    },
})
rajvatsal commented 4 weeks ago

the options you tried to use aren't meant to disable all icons in the ui they just disable the icons in the mapping hints

vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()

require("lazy.minit").repro({
    spec = {
        {
            "folke/which-key.nvim",
            opts = {
                icons = {
                    mappings = false,
                    rules = false,
                    breadcrumb = ">",
                    separator = ">",
                    ellipsis = ".",
                    keys = {
                        Up = "^ ",
                        Down = "v ",
                        Left = "< ",
                        Right = "> ",
                        C = "^-",
                        M = "m-",
                        D = "dd",
                        S = "s-",
                        CR = "cr",
                        Esc = "esc ",
                        ScrollWheelDown = "v",
                        ScrollWheelUp = "^ ",
                        NL = "nl",
                        BS = "bs",
                        Space = "_",
                        Tab = ">>",
                        F1 = "f1",
                        F2 = "f2",
                        F3 = "f3",
                        F4 = "f4",
                        F5 = "f5",
                        F6 = "f6",
                        F7 = "f7",
                        F8 = "f8",
                        F9 = "f9",
                        F10 = "f10",
                        F11 = "f11",
                        F12 = "f12",
                    },
                },
            },
        },
    },
})

I still can't remove icons.

return {
  -- Useful plugin to show you pending keybinds.
  'folke/which-key.nvim',
  event = 'VeryLazy',
  opts = { icons = { mappings = false, rules = false } },
  config = function(_, opts)
    local wk = require 'which-key'
    -- document existing key chains
    wk.add {
      { '<leader>c', group = '[C]ode' },
      { '<leader>d', group = '[D]ocument' },
      { '<leader>g', group = '[G]it' },
      { '<leader>m', group = '[M]ove' },
      { '<leader>b', group = '[B]uild' },
      { '<leader>h', group = 'Git [H]unk' },
      { '<leader>r', group = '[R]ename' },
      { '<leader>s', group = '[S]earch' },
      { '<leader>t', group = '[T]oggle' },
      { '<leader>w', group = '[W]orkspace' },
    }
    -- register which-key VISUAL mode
    -- required for visual <leader>hs (hunk stage) to work
    wk.add {
      { '<leader>', group = 'VISUAL <leader>' },
      { '<leader>h', group = 'Git [H]unk', mode = 'v' },
    }
  end,
}

Screenshot (17)

Edit: I only want to remove icons that I've circled in the screenshot.

max397574 commented 4 weeks ago

well your config is wrong in the config you also have to call which-key setup with your opts