https://github.com/gierens/neovim-plugin
Sample for a Lua-based Neovim plugin.
https://github.com/gierens/neovim-plugin
example lua neovim neovim-plugin plugin sample todolist vimscript
Last synced: about 1 month ago
JSON representation
Sample for a Lua-based Neovim plugin.
- Host: GitHub
- URL: https://github.com/gierens/neovim-plugin
- Owner: gierens
- License: mit
- Created: 2022-11-27T15:04:41.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-11-27T18:02:57.000Z (over 3 years ago)
- Last Synced: 2025-04-02T04:09:08.676Z (about 1 year ago)
- Topics: example, lua, neovim, neovim-plugin, plugin, sample, todolist, vimscript
- Language: Lua
- Homepage:
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# neovim-plugin
Sample for the Neovim plugin written in Lua, based on the Linode tutorial:
https://www.linode.com/docs/guides/writing-a-neovim-plugin-with-lua/ .
The original repository the article is based on is:
https://github.com/jacobsimpson/nvim-example-lua-plugin .
It also contains some helpful hints about Lua in Neovim for example.
This example Neovim plugin displays and allows you to update a todo list.
The todo list is stored in a SQLite 3 database located at `~/.todo.db`.
## Installation
1. Example Plugin requires that you have [SQLite 3](https://www.sqlite.org/index.html) installed on your system.
On Linux, you can generally install SQLite 3 using your distribution's package
manager. On macOS, you can install it via [Homebrew](https://brew.sh/). And on Windows, use the
link above to locate a download for SQLite.
2. Use your favorite Vim or Neovim plugin manager to add Example Plugin.
With [vim-plug](https://github.com/junegunn/vim-plug), just add this line to your plugin configuration:
`Plug 'gierens/neovim-plugin'`.
## Usage
Example Plugin allows you to view and update a list of todo tasks. You can
use these commands to interact with the tasks:
- `FetchTodos` shows your current todo tasks.
- `InsertTodo` lets you add a new task, prompting you for its description.
- `CompleteTodo` lets you mark a task completed by selecting the task from
a list.
You may want to map these to key bindings for easy access. Here are some
example key bindings you can add to your Neovim configuration file:
nnoremap zf :FetchTodos
nnoremap zi :InsertTodo
nnoremap zc :CompleteTodo
By default, the leader key is `\`, so this would let you access the functions by
pressing **\\** followed by **Z** followed by one other key.