jeetsukumaran / vim-indentwise

A Vim plugin for indent-level based motion.
220 stars 17 forks source link

Fix indentwise mappings #1

Closed pgdouyon closed 9 years ago

pgdouyon commented 9 years ago

Fix typo in hasmapto() checks that causes the default mappings to always be executed if the user did not explicitly set g:indentwise_suppress_keymaps, even if the user has already mapped those functions.

Move <silent> argument from the default mappings to the <Plug> mappings, to prevent the function call from being echoed on the command line if the user remapped the <Plug> mappings without the <silent> argument.

jeetsukumaran commented 9 years ago

Thanks!

pgdouyon commented 9 years ago

No problem! Also, slightly off-topic, I read through the reddit thread concerning the awkwardness of the default mappings. I also find the default mappings to be a bit awkward and a big strain on my pinky. I know the mappings work for you but I wanted to propose an alternative default mapping if you're interested.

I'm currently using <, =, > to move to less/equal/greater indent depth and u, d to move up/down (next/previous). I think the mnemonic works well and u/d aren't motion commands (unlike j/k which would cause k to overwrite default vim behavior), it's also less of a pinky workout.

Just figured I'd throw it out there in case you're considering other default mappings.

jeetsukumaran commented 9 years ago

Do you mean, e.g. <u to move to a previous line with lesser indent?

It might be a good compromise between practicality (i.e. not awkward like the current default) and logical/mnemonic. But one thing that the reddit discussion showed me is that everyone has different opinions, what works for some folks make others recoil! So it might be best just to let everyone define their own set.

pgdouyon commented 9 years ago

Yup that's exactly how it would work! Although it's definitely true that everyone has different opinions, I don't think that should prevent providing really good defaults, as long as people have an option to change them.

I don't think the current defaults are so bad that they need to be changed. The mnemonic for them makes a lot of sense and is easy to remember. I just wanted to propose the mappings I'm currently using in case you found that you preferred them and wanted to use those as the default instead.