Loading relative line on operator pending wont load #2
-
|
Ok, its probably something simple but this: {
'rasulomaroff/reactive.nvim', -- detect eg. operator pending mode
config = function()
require('reactive').setup{
-- builtin = {
-- cursorline = false,
-- cursor = false,
-- modemsg = false
-- },
configs = {
-- a key here is a preset name, a value can be a boolean (if false, presets will be disabled)
-- or a table that overwrites preset's values
presetone = {
name = 'test',
modes = {
no = {
to = function()
vim.opt.relativenumber = true
end,
from = function()
vim.opt.relativenumber = false
end,
},
}
},
}
}
end,
}, Does do nothing for me. I tried to call |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 9 replies
-
|
Hi there! @JoseConseco To actually add a preset you have 2 options that listed in the end of the README file. I'm gonna change it so that it's easier for you to find it. The first way
The second wayYou use require('reactive').add_preset {
-- your config for preset here
}I actually use the first way since it fits me better :) Solution for your question: require('reactive').add_preset {
name = 'test',
modes = {
no = {
to = function()
vim.opt.relativenumber = true
end,
from = function()
vim.opt.relativenumber = false
end
}
}
}You don't need to call |
Beta Was this translation helpful? Give feedback.
-
|
@rasulomaroff It works. Indeed that was collision mapping - removing which key addon made it work. Now I press just Peek.2024-01-22.21-07.mp4The only issues is , I cannot live without https://github.com/folke/which-key.nvim :/ . Is tere any chance for you to support which-key. nvim ? |
Beta Was this translation helpful? Give feedback.
-
|
This was SO helpful! I realised early on |
Beta Was this translation helpful? Give feedback.
-
|
Just wanted to say, that new Which key is out , and now reactive works ok with it. Soo cool.. {
'rasulomaroff/reactive.nvim', -- detect eg. operator pending mode
config = function()
require('reactive').setup{
-- builtin = {
-- cursorline = false,
-- cursor = false,
-- modemsg = false
-- },
configs = {
-- a key here is a preset name, a value can be a boolean (if false, presets will be disabled)
-- or a table that overwrites preset's values
}
}
require('reactive').add_preset {
name = 'test',
modes = {
no = {
to = function()
vim.opt.relativenumber = true
end,
from = function()
vim.opt.relativenumber = false
end
}
}
}
end,
}, |
Beta Was this translation helpful? Give feedback.
Hi there! @JoseConseco
The reason nothing is happening because
configsfield is meant to configure already added presets.To actually add a preset you have 2 options that listed in the end of the README file. I'm gonna change it so that it's easier for you to find it.
The first way
reactive/presets/yourpresetname.luafolder & filerequire('reactive').load_preset 'yourpresetname'The second way
You use
I actually use the first way since it fits me better :)
Solution for your question: