An open API service indexing awesome lists of open source software.

https://github.com/jeangiraldoo/neovim-plugin-template

An all-in-one template to get you up and running with your next Neovim pluginπŸš€βœ¨
https://github.com/jeangiraldoo/neovim-plugin-template

neovim neovim-plugin-template plugin-template

Last synced: over 1 year ago
JSON representation

An all-in-one template to get you up and running with your next Neovim pluginπŸš€βœ¨

Awesome Lists containing this project

README

          

# A Neovim plugin template


Neovim logo
The template is for Lua plugins

Latest version

Repository size in KB

Welcome to your new, batteries-included Neovim plugin template!
This beginner-friendly template is designed to make creating Neovim
plugins with Lua as simple as possible by providing everything you
need right out of the box.

Every file and folder is thoroughly documented so you can easily
understand its purposeβ€”whether you're just starting your plugin
journey, looking to learn some new tricks, or simply brushing up
on your skills.

I hope you enjoy it and happy coding!

## πŸ“– Table of Contents

- [Features](#features)
- [Plugin Structure Overview][plugin_structure]
- [Get started](#get-started)
- [Code Formatting and Linting](#code-formatting-and-linting)
- [Markdown Linting](#markdown-linting)

## πŸš€ Features

- **Continuous Integration:** Utilizes GitHub Actions to ensure
consistent code quality by checking:

- Code formatting with [Stylua][stylua]
- Lua linting with [Luacheck][luacheck]
- Markdown linting with [Markdownlint][markdownlint]

- **Standard Directory Structure:** Comes with a well-organized
base directory and file structure designed for Neovim plugin
development.

- **Prebuilt README Template:** Includes a structured README with
essential sections, so you can focus on content instead of
setting up headers, a table of contents, and formatting.

## πŸ“‚ Plugin Structure Overview

```bash
.
β”œβ”€β”€ lua
β”‚ └── plugin_name
β”‚ └── init.lua
β”œβ”€β”€ plugin
β”‚ └── plugin_name.lua
β”œβ”€β”€ doc
β”‚ └── plugin_name.txt
β”œβ”€β”€ .github
β”‚ β”œβ”€β”€ FUNDING.yaml
β”‚ └── workflows
β”‚ β”œβ”€β”€ markdown_linting.yaml
β”‚ └── code_checks.yaml
β”œβ”€β”€ README_TEMPLATE.md
└── README.md
```

- **lua/plugin_name:** This directory is automatically loaded
by Neovim and is intended to hold your plugin’s core logic.

- **plugin:** Lua files in this directory are also auto-loaded by
Neovim. Typically, this folder is used for code that sets
up autocommands, user commands, keymaps, etc.β€”complementing
the core functionality in lua/plugin_name.

- **doc:** Contains documentation that can be accessed from within
Neovim using the `:help` command.

- **.github:** Holds GitHub configuration files such as workflows
and funding details. (This folder is ignored by Neovim.)

## πŸ’» Get started

Follow these steps to use the template:

1. Clone or Create from Template: Either clone this repository,
or if you're on GitHub, click the "Use this template" button
at the top-right of the repository page and select "Create
new repository".
1. Rename Instances: Use the [plugin structure][plugin_structure] as a guide,
and replace every instance of plugin_name with the name of
your plugin.
1. Replace the FUNDING.yaml file with your own or delete it,
as this file is used in this template repository to display
my "Sponsor" button.
1. (Optional) Customize: Adjust the dotfiles or other
configuration defaults to better match your desired plugin
style.
1. Have fun working on your plugin! :)

## πŸ› οΈ Code Formatting and Linting

This template enforces consistent coding standards by integrating:

- Stylua for code formatting.
- Luacheck for linting Lua code.

These checks run automatically via GitHub Actions, ensuring that your
code remains clean and error-free.

For an even smoother development experience, consider using a Neovim
autoformatter like [Conform](https://github.com/stevearc/conform.nvim),
which formats your code on every save.

## πŸ“ Markdown Linting

To maintain well-formatted documentation, Markdown files are linted
using [Markdownlint][markdownlint]. This ensures that your README and any additional
documentation follow best practices.

> **Note:** If you prefer not to use Markdownlint for your project, simply remove
> the markdown_linting.yaml workflow file.

[plugin_structure]: #plugin-structure
[markdownlint]: https://github.com/DavidAnson/markdownlint
[stylua]: https://github.com/JohnnyMorganz/StyLua
[luacheck]: https://github.com/mpeterv/luacheck