m4xshen / hardtime.nvim

Establish good command workflow and quit bad habit
MIT License
1.38k stars 26 forks source link

feat: maintain remapped behaviour #4

Closed TheSast closed 1 year ago

TheSast commented 1 year ago

Currently, for example, setting j and k to gj and gk won't work since it will be overridden by this plugin. (At least, I think this is what is happening, as the example situation in question only seems to appear when I have this plugin enabled.)

m4xshen commented 1 year ago

What do you mean about setting j to gj? The user config will override the default config.

TheSast commented 1 year ago

That was just one example. Another would be: If the user maps j to k and k to j for whatever reason, after enabling this plugin, they will see the original functions of j and k restored.

This also leads to breaking compatibility with WhichKey (e.g. d showing all operators avilable)

directormac commented 1 year ago

I think he is refering to frameworks that overrides j and k Most of the "neovim frameworks" use the following for better scrolls

here is an example for Lazyvim, hardtime.nvim sometimes fail to overlap those keys. also tried adding gk and gj to the keys still hardtime wont recognize them.

-- better up/down
map({ "n", "x" }, "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
map({ "n", "x" }, "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
m4xshen commented 1 year ago

Thanks I got it. I'm finding way to fix this.

TheSast commented 1 year ago

thank you very much, sorry about my explanation not being clear.