boltlessengineer / smart-tab.nvim

Easily jump to the end of current node.
55 stars 0 forks source link

Some feedback about configuration #2

Open wookayin opened 1 year ago

wookayin commented 1 year ago

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:

  1. Ideally, a plugin should be working without an explicit .setup{} call.

  2. Consider using plugin/*.lua to define vim.keymap.set("i", "<plug>(smart-tab)", smart_tab) because the plugin explicitly requires to import (require) lua/smart-tab.lua in order to work.

  3. 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 '(smart-tab)` literally.

  4. Error handling should be added on buffers with no treesitter parser configured (or even filetype='').

  5. 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.

  6. Minor nitpcking: space should be preferred over tabs.

boltlessengineer commented 1 year ago

Thank you for your advices!

  1. .setup{} is there to allow users to only load plugin when they want and avoid the unexpected behaviors.
  2. same to 1
  3. 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?
  4. Good point. I'll add it
  5. Just changed back to global keymap to fix some bugs.
  6. Didn't noticed I was using spaces lol. Fixed formatter rules.
RAV64 commented 1 year ago

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 :)