cvigilv / esqueleto.nvim

Reduce your boilerplate code the lazy-bones way
MIT License
100 stars 7 forks source link

Manage templates in a similar fashion to how `ftplugin` works #5

Closed cvigilv closed 1 year ago

cvigilv commented 1 year ago

ftplugin consists of a series of directories for a specific filetype; inside this, you can add vim scripts to set options and/or add functionality. This issue intends to change the current design (pretty messy tbh) and move to a design inspired by this directory structure and function.

For this, we need to scrap the matching of regex patterns (*.py, for example) and change this to respond to filetype (vim.bo.filetype). For filename-matching patterns, we will maintain the current design of matching the whole file name but move the templates into a directory with this name.

So, the design will change from:

skeletons
├── skeleton.cli.jl
├── skeleton.jl
├── skeleton.license-Apache20.md
├── skeleton.license-GNUGPLv3.md
├── skeleton.license-MIT.md
├── skeleton.license-Unlicense.md
├── skeleton.module.jl
└── skeleton.tests.jl

To:

skeleton
├── julia
│  ├── cli
│  ├── default
│  ├── module
│  └── tests
└── LICENSE
   ├── Apache20
   ├── GNUGPLv3
   ├── MIT
   └── Unlicensed