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
4.99k stars 160 forks source link

bug: Neorg local keymap is not displayed #519

Closed Flygrounder closed 3 weeks ago

Flygrounder commented 10 months ago

Did you check docs and existing issues?

Neovim version (nvim -v)

0.9.2

Operating system/version

Arch Linux

Describe the bug

Whenever I open a .norg note, which-key does not work with it's local keymap, unless I press <C-w><C-w>.

Steps To Reproduce

  1. :Neorg workspace notes
  2. Press \ (local leader)
  3. Nothing happens
  4. To make sure, that local keymap is defined, press \nn (create new note), it works as expected, but which-key for some reason does not know about that.
  5. <C-c> to close note creation dialogue.
  6. <C-w><C-w>
  7. Press \
  8. Now which-key shows local keymap as expected

Expected Behavior

which-key should show keymap without needing to press <c-w><c-w>

Repro

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
    vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
    vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
    "folke/tokyonight.nvim",
    { "folke/which-key.nvim", config = true },
    -- add any other plugins here
    {"nvim-treesitter/nvim-treesitter", build = ":TSUpdate"},
    {
        "nvim-neorg/neorg",
        build = ":Neorg sync-parsers",
        dependencies = { "nvim-lua/plenary.nvim" },
        config = function()
            require("neorg").setup {
                load = {
                    ["core.defaults"] = {}, -- Loads default behaviour
                    ["core.concealer"] = {}, -- Adds pretty icons to your documents
                    ["core.dirman"] = { -- Manages Neorg workspaces
                        config = {
                            workspaces = {
                                notes = "~/notes",
                            },
                        },
                    },
                },
            }
        end,
    },
}
require("lazy").setup(plugins, {
    root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here
github-actions[bot] commented 1 month ago

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.