-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: remapped keys are unmapped after exiting resize mode #192
Comments
Can probably do something like this https://github.com/tjdevries/stackmap.nvim |
@rwijtvliet could you test #193 and see if it works for you? |
I think the issue is solved! When exiting resize mode, the keys are correct again. There is one thing that I'm not sure about, but that's probably due to an error in my config. And that is, that the (...)
require('smart-splits').setup {
opts = {
ignored_filetypes = { 'nofile', 'quickfix', 'qf', 'prompt' },
ignored_buftypes = { 'nofile' },
resize_mode = {
quit_key = '<Esc>', -- key to exit persistent resize mode
resize_keys = { 'h', 'n', 't', 's' }, -- !!!!
silent = false,
hooks = {
on_enter = function()
vim.notify 'Entering window resize mode, press <esc> to exit.'
end,
on_leave = function()
vim.notify 'Resize finished.'
require('bufresize').register()
end,
},
at_edge = 'stop',
},
},
}
-- Wanted mappings for navigation (dvorak keyboard)
vim.keymap.set('', 'h', 'h', { desc = 'Move left' }) -- for completeness
vim.keymap.set('', 'n', "v:count == 0 ? 'gj' : 'j'", { expr = true, desc = 'move down' })
vim.keymap.set('', 't', "v:count == 0 ? 'gk' : 'k'", { expr = true, desc = 'move up' })
vim.keymap.set('', 's', 'l', { desc = 'move right' })
vim.keymap.set('', 'H', 'H', { desc = 'Move cursor to top of screen' }) -- for completeness
vim.keymap.set('', 'S', 'L', { desc = 'Move cursor to bottom of screen' })
vim.keymap.set('n', 'T', 'K', { remap = true, desc = 'Help' })
vim.keymap.set('n', 'j', 's', {desc = 'substitute character'})
vim.keymap.set('', 'k', 't', {desc = 'Till (fwrd)'})
vim.keymap.set('n', '<A-b>', function() require('smart-splits').start_resize_mode() end, { desc = 'Resize' })
(...) I'd like to fix this error before I give the final feedback |
It looks like you copy/pasted from lazy.nvim or something, as your entire plugin config is nested under |
Yep, that was it. Works now, many thanks! |
Hi, I use nvchad which has a default mapping of the Esc key to ":noh " to clear highlights after a search. |
@beatmax should be fixed in latest commit on |
Thanks @mrjones2014 . It's better now, but there's still an issue which can be reproduced like this:
Thanks. |
Could you open another issue with a minimal reproducible |
Sure, no problem. I expected it can be reproduced without nvchad. I'll try to confirm it and open a new ticket. Thanks! |
Similar Issues
Neovim Version
0.9.5
Multiplexer Integration
I don't use one
Multiplexer Version
No response
Steps to Reproduce
Expected Behavior
Mapping is preserved
Actual Behavior
Mapping is reset to vim standard
Minimal Configuration to Reproduce
Additional Details and/or Screenshots
See the code above, which includes a workaround in the
on_leave
function.The text was updated successfully, but these errors were encountered: