README.md
April 13, 2025 ยท View on GitHub
utils.nvim is a Neovim plugin that provides a collection of utilities to simplify the development of your Neovim plugins.
โจ Features
- Caching Mechanism: Implements a caching system to store data and reduce unnecessary command execution, optimizing performance.
- Notification Management: Offers functions to queue and display notifications, allowing seamless user communication within plugins.
- Shell Execution: Includes capabilities to execute commands async, work with system tools, improving workflow efficiency.
- More!
โก Setup
โ๏ธ Requirements
plenary.nvimnvim-web-devicons(optional, for language icons)
๐ป Installation
utils.nvim is not meant to be installed by itself, but rather as a dependency for another plugin.
If you are building a plugin that requires the utilities provided by utils.nvim, you can add it as a dependency as shown below:
-- Lazy
{
'yourname/plugin.nvim',
dependencies = {
'2kabhishek/utils.nvim'
},
},
๐ Usage
Modules
utils.nvim is divided into several modules, each providing specific functionalities:
cache: a module for caching data and managing cache files.notification: a module for simplifying notification queues.language: a module for programming language filetype and icon management.shell: a module for executing shell commands and opening URLs, files.json: a module for handling JSON data.time: a module for working with time and date.
Commands
utils.nvim adds the following command:
UtilsClearCache: Clears all cache files saved by the plugin. To execute it, run:
Help
Run :help utils.txt for more details.
๐๏ธ What's Next
Planning to add <feature/module>.
โ To-Do
- You tell me!
โ Behind The Code
๐ Inspiration
utils.nvim was created while working on octohub.nvim which relied on a lot of common utilities like async shell execution, notifications, and caching.
๐ก Challenges/Learnings
- Figuring out the callback mechanism for async functions was a bit tricky.
- Learned better ways to handle caching and notifications.
๐ More Info
- octohub.nvim โ All your GitHub features in Neovim, uses utils.nvim
- nerdy.nvim โ Find nerd glyphs easily
- tdo.nvim โ Fast and simple notes in Neovim
โญ hit the star button if you found this useful โญ
Source | Blog | Twitter | LinkedIn | More Links | Other Projects