Skip to content

Reduce your boilerplate code the lazy-bones way

License

Notifications You must be signed in to change notification settings

z775729168/esqueleto.nvim

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

esqueleto.nvim

Reduce your boilerplate code the lazy-bones way.

What is esqueleto?

Preview

esqueleto.nvim is a minimal plugin that intends to make the use of templates or "skeletons" as easy and straightforward as possible. This package adds a prompt for inserting a specific template when creating a new file that matches a specific file name or pattern.

Installation

Install esqueleto.nvim with your preferred package manager:

vim-plug

# Stable
Plug 'cvigilv/esqueleto.nvim'

# Development (latest)
Plug 'cvigilv/esqueleto.nvim', { 'branch': 'develop'}

packer

-- Stable
use 'cvigilv/esqueleto.nvim'

-- Development (latest)
use { 'cvigilv/esqueleto.nvim', branch = "develop" }

Usage & configuration

To configure esqueleto.nvim and use it, the following should be present in your init.lua:

require("esqueleto").setup(
    {
      -- Template directories
      directories = {"~/.config/nvim/skeletons/"},

      -- Patterns to match when creating new file
      -- Can be either (i) file names or (ii) file types.
      -- Exact file name match have priority
      patterns = { "README.md", "python" },

      -- whether to auto-use a template if it's the only one for a pattern
      autouse = true,

      advanced = {
        -- List of files glob patterns to ignore
        -- Or alternatively, a function that determines if a file should be ignored
        ignored = {},

        -- Ignore OS files like .DS_Store
        -- Exhaustive list: https://www.toptal.com/developers/gitignore/api/windows,macos,linux
        ignore_os_files = true,
      },
    }
)

For more information, refer to docs (:h esqueleto). For example skeleton files, check the skeletons folder.

The default options of esqueleto are

    {
      directories = { vim.fn.stdpath("config") .. "/skeletons" },
      patterns = { },
      autouse = true,
      advanced = {
        ignored = {},
        ignore_os_files = true,
      }
    }

Roadmap

esqueleto.nvim is in its infancy (expect breaking changes from time to time). I intend on extending this plugin with some functionality I would like for a template manager. At some point esqueleto.nvim should have the following (ordered by priority):

  • Template creation interface
  • Project specific templates
  • Template preview via Telescope
  • User customizable prompt and insertion rules

Contributing

Pull requests are welcomed for improvement of tool and community templates. Please contribute using GitHub Flow. Create a branch, add commits, and open a pull request.

Please open an issue for support.

About

Reduce your boilerplate code the lazy-bones way

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Lua 89.7%
  • Julia 9.7%
  • Python 0.6%