Closed seb-mueller closed 10 months ago
The following line
vim.keymap.set("n", "f", next.make_repeatable_pair(functions.F, functions.f))
doesn't work because there is no functions
variable. (my bad, I will correct the readme)
Having said that, this line is redundant (again, I should make it more clear in the readme) provided that you have:
items = {
nvim_next_builtins.f,
nvim_next_builtins.t
}
which does exactly that during the setup.
The offensive line is only needed if someone would like to setup mapping on their own (e.g. to something else than f
/t
).
I created #18 to address this issue, let me know if it clarifies enough.
Thanks for the clarification and provided code. I suppose I'll just remove the lines in questions, however for the sake of testing, I've tried you suggested, but get a new error:
E5108: Error executing lua vim/keymap.lua:0: opts: expected table, got function
stack traceback:
[C]: in function 'error'
vim/shared.lua: in function 'validate'
vim/keymap.lua: in function 'set'
[string ":lua"]:17: in main chunk
Again, the same line is the culprit. This is my vim entry:
lua << EOF
local nvim_next_builtins = require("nvim-next.builtins")
require("nvim-next").setup({
default_mappings = {
repeat_style = "original",
},
items = {
nvim_next_builtins.f,
nvim_next_builtins.t
}
})
local next_integrations = require("nvim-next.integrations")
local nqf = next_integrations.quickfix()
local next = require("nvim-next").setup()
vim.keymap.set("n", "[d", nqf.cprevious, { desc = "previous quickfix list item" })
vim.keymap.set("n", "]d", nqf.cnext, { desc = "next quickfix list item" })
local functions = require("nvim-next.builtins.functions")
vim.keymap.set("n", "f", next.make_repeatable_pair(functions.F, functions.f))
EOF
sorry I was writing this from the top of my head and didn't have time to test it.
I forgot that the next.make_repeatable_pair
function returns pair of functions (prev and next).
I updated the readme accordingly.
Thanks for catching that mistake :+1:
I tried to get this plugin to work, but are getting an error when sourcing my vimrc: It works fine up to this stage, since
map ;
rightfully maps tonvim-next
However when adding the line before EOF
it throws:
However it seems those lines are working
None of the mapping (; or ,) do the desired though (i.e. repeating), probably because of this issue.