Some feedback about configuration
Hi, thanks for the great plugin and the idea looks very interesting. Here are some feedbacks/improvements that you can consider regarding plugin init/config:
-
Ideally, a plugin should be working without an explicit
.setup{}call. -
Consider using
plugin/*.luato definevim.keymap.set("i", "<plug>(smart-tab)", smart_tab)because the plugin explicitly requires to import (require)lua/smart-tab.luain order to work. -
Manual keymap
vim.keymap.set("i", "<tab>", "<plug>(smart-tab)")does not work because remap is false by default. One will need the{ remap = true }option. So the current behavior is like inserting the string '<Plug>(smart-tab)` literally. -
Error handling should be added on buffers with no treesitter parser configured (or even filetype='').
-
A question: Why buffer-local keymap is created rather than a global keymap? This would work in almost all the cases except for when plugin is loaded lazily.
-
Minor nitpcking: space should be preferred over tabs.
Thank you for your advices!
-
.setup{}is there to allow users to only load plugin when they want and avoid the unexpected behaviors. - same to 1
- I can't quite understand what do you mean. Manual
vim.keymap.set("i", "<tab>", "<plug>(smart-tab)")works in my config. Can you share more detailed situation? - Good point. I'll add it
- Just changed back to global keymap to fix some bugs.
- Didn't noticed I was using spaces lol. Fixed formatter rules.
Hey! Sorry to be a burden on this, really loved the simplicity of your plugin. My only suggestion here is possible table of differences between similar plugins (tabout, actual helix functionality.. else?) Anyways - Great work and a cool idea :)