typed-rocks / ts-worksheet-neovim

Instant code results of your TypeScript or JavaScript code right inside your editor.
MIT License
34 stars 1 forks source link

Restructure into a Neovim plugin via LazyVim #1

Closed heilgar closed 1 month ago

heilgar commented 2 months ago

Thank you for your fantastic plugin! I came across your video on YouTube and decided to add the possibility of installing your plugin via LazyVim. While the original installation method remains available, I find it more convenient to manage plugins through a centralized manager like LazyVim. I've also included help documentation accessible within Vim via :h tsw.

To maintain backward compatibility, I've copied most of the content from ts-worksheet.lua to utils.lua. This ensures that everything continues to work seamlessly with the new installation method.

Please let me know if there's anything else you'd like me to adjust or improve!

Changes

Rationale

  1. Maintainability: The code is now split into modules, making it easier to maintain and extend in the future.

  2. Organization: Each module handles a specific task, making the codebase more organized and understandable.

  3. Configuration: The new structure simplifies configuration management with the config.lua file.

  4. User Experience:

    • Added user commands and autocommands in commands.lua for better Neovim integration.
    • Help documentation is accessible with :h tsw.
  5. Familiarity: The structure now follows standard Neovim plugin conventions, making it more user and contributor-friendly.

chwoerz commented 2 months ago

This is awesome. Thank you. I will check it out later today. Thanks for your work

chwoerz commented 1 month ago

@heilgar Thank you so much for the cool change. It was merged and I'm already using it like that myself. I'm a newby in neovim, so your help was greatly appreciated.

heilgar commented 1 month ago

@chwoerz No problem at all. Thank you again for your plugin; it's been really helpful!

Just a heads-up: if you need to add or update functionality, you might need to support both files—one in the root and the other in utils—if you plan to keep the previous structure. If not, it might be better to remove the root file and have a single source of truth.

Here’s a reference on how it can be developed locally using a plugin-based approach:

https://github.com/heilgar/nvim-http-client/blob/main/doc/how-to-dev-plugin.md

chwoerz commented 1 month ago

I will most likely remove the other file 👍