Closed divramod closed 10 months ago
I think adding another binding just for switching between two modes complicates things a lot and now you must have some sort of indicator to know you're allowed to use h or l in my opinion there's no much use of h or l in explorer must of things can be done with other motions
I generally agree with @mortezadadgar on this one. Your brain has two competing pieces of muscle memory: one for navigating buffers and one for navigating a file structure. You could do what you're suggesting; you can set the keymaps directly:
vim.keymap.set('n', 'h', require("oil.actions").parent.callback, {buffer = 0})
And then you can use another command to dynamically change those mappings. But that effectively adds another mode to your vim, that only exists within oil. Definitely doable, and if it's what you prefer and works for you, more power to you. However I would recommend unlearning either one set of keymaps or the other. You can rebind the .parent
and .select
to keys that are closer to your home row.
@stevearc thx for the solution!
@mortezadadgar i am thinking a lot about this (how to optimise speed, how to set mappings for optimising speed). the switch is what seems to be the right thing for me at this time.
hey hey,
thx again for the awesome plugin!
i have a question:
i got used to using the h and l keys for navigating to the parent dir and selecting the current item while using ranger. in oil, h and l are mapped for the normal mode movements. parent and select are done by
-
and=
.-
and=
are to far away for me, i navigate files really often. so i somehow need theh
andl
keys for both, navigating the current line and navigating to parent/select.i remapped h and l in my keymaps like this
the problem now is, that i can't use h and l, when i want to work on the current line.
so my question is, if there is a way to somehow toggle these 2 keymappings (l and h) with another keymap in oil.
so for example if i press
gt
for toggle keymaps, nvim switches the keymaps to the normal mode h|l functionality in the current oil buffer, so that i can navigate the current line in the current oil buffer and if i pressgt
again it switches back toactions.parent
andactions.select
.is there anyone having other ideas on how i could fix my usage problems? am i using oil the wrong way? i am open for everything, to be as fast as possible ;-)
i would love to completely switch to oil from ranger. this seems to be the last hinderance.