Closed akinsho closed 2 years ago
@akinsho It does (the mapping actually will toggle nvim-tree
). There is however another problem (can't really tell where is the problematic symbol or whatever is).
Here is the error I'm getting if I try to use mapping \[
to open nvim-tree
right after nvim startup:
E5107: Error loading lua [string ":lua"]:1: invalid escape sequence near '''
The reason is lazy loading (?) Here is how I load it:
use({
"kyazdani42/nvim-tree.lua",
keys = { "\\[", "\\g" },
cmd = "NvimTreeFindFileToggle",
config = function()
require("settings.nvim-tree")
end,
})
So we waiting for either one of two key combinations or the command.
With this fix I can run the command and then the mappings work fine. But keys defined in use
result in the error mentioned above.
PS: without lazy loading - mappings work as expected.
@konart thanks for trying this out, can you try again and see if it's resolved now, I've made some changes
@akinsho
Okay, keymaps starting with \
now do work.
The ones starting with <Leader>
do not though.
For example if I load Trouble like this:
use({
"folke/trouble.nvim",
requires = "kyazdani42/nvim-web-devicons",
config = function()
require("settings.trouble")
end,
module = "telescope",
cmd = { "TroubleToggle", "TroubleRefresh" },
keys = { "<Leader>tt" },
})
@konart are you sure it's the mapping that isn't working, since unless you have mapped trouble to also open using <leader>tt
it will be loaded, but trouble will not open using the setup you have above?
I just tested my localleader and leader mappings, and they seem to work fine.
I believe this PR has bugs, now I cannot lazy load any packages. Please check again.
use({
"numToStr/Comment.nvim",
keys = { { "n", "<C-_>" }, { "n", "gcc" }, { "n", "gc" }, { "v", "<C-_>" } },
config = config("Comment"),
})
this is my config
Ok I think I give up, I'm going to just revert all the changes
@akinsho sorry for the late reply. In my case the problem was with this part: module = "telescope",
not with the changes to packer. I guess at some point I just forgot about the changes I've made...
I've tried @captainko keys for Comment
too - and at least gcc
worked fine for me.
No worries @konart for now I'm just going to hold off any such changes till when packer is refactored hopefully we won't be doing any more compilation so adding descriptions to lazyload maps will be much easier
@konart can you please test this branch to see if it fixes your issue
fixes #988