Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/javiorfo/nvim-spinetta
Neovim library written in Lua for using a spinner during a job process
https://github.com/javiorfo/nvim-spinetta
jobs lua neovim neovim-plugin neovim-spinner spinner
Last synced: about 2 months ago
JSON representation
Neovim library written in Lua for using a spinner during a job process
- Host: GitHub
- URL: https://github.com/javiorfo/nvim-spinetta
- Owner: javiorfo
- License: other
- Created: 2023-02-03T17:18:47.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-08-14T02:23:48.000Z (5 months ago)
- Last Synced: 2024-08-14T03:59:39.951Z (5 months ago)
- Topics: jobs, lua, neovim, neovim-plugin, neovim-spinner, spinner
- Language: Lua
- Homepage:
- Size: 101 KB
- Stars: 16
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nvim-spinetta
*nvim-spinetta is a Neovim library written in Lua for using a spinner during a job process.*## Caveats
- This library has been developed on and for Linux following open source philosophy.## Installation
`Packer`
```lua
use 'javiorfo/nvim-spinetta'
```
`Lazy`
```lua
{ 'javiorfo/nvim-spinetta' }
```## Overview
| Feature | nvim-spinetta | NOTE |
| ------- | ------------- | ---- |
| Spinners | :heavy_check_mark: | Includes 6 spinners |
| Set your own spinner | :heavy_check_mark: | |
| Set a job | :heavy_check_mark: | |
| Set a another process not only a job | :heavy_check_mark: | |
| **start** function | :heavy_check_mark: | Several overloads |
| On success option | :heavy_check_mark: | By the user |
| On interruption option | :heavy_check_mark: | By the user or by an internal error |## Usage
- By default the values by parameters are:
```lua
{
spinner = DEFAULT_SPINNER, -- List of figures to use in the spinner
speed_ms = 200, -- Speed of the spinner in miliseconds
main_msg = "", -- Initial message in spinner
on_success = nil, -- Function to implement when the job is finished
on_interrupted = nil -- Function to implement when the job is interrupted
}
```- First, create a instance:
```lua
local spinetta = require'spinetta'
local my_spinner = spinetta:new()
```- Second, start the spinner and the job:
```lua
local my_job = "curl https://host/path" -- This is ilustrative, change it by your job to run
my_spinner:start(spinetta.job_to_run(my_job))
```#### SPINNERS
- Check the spinners availables in [this file](https://github.com/javiorfo/nvim-spinetta/blob/master/lua/spinetta/spinners.lua)
- You can add your own spinner if you like. Further information in `:help spinetta`## Screenshots
#### Examples of the differents spinners included in this plugin. Run `:luafile %` in [this file](https://github.com/javiorfo/nvim-spinetta/blob/master/examples/test_spinners.lua)#### Examples of interruption message included in this plugin. Run `:luafile %` and interrupt the process with `Ctrl-C` in [this file](https://github.com/javiorfo/nvim-spinetta/blob/master/examples/test_interruption.lua)
**NOTE:** The colorscheme **nebula** from [nvim-nyctophilia](https://github.com/javiorfo/nvim-nyctophilia) is used in this image.
---
### Donate
- **Bitcoin** [(QR)](https://raw.githubusercontent.com/javiorfo/img/master/crypto/bitcoin.png) `1GqdJ63RDPE4eJKujHi166FAyigvHu5R7v`
- [Paypal](https://www.paypal.com/donate/?hosted_button_id=FA7SGLSCT2H8G)