nvim-spinetta is a Neovim library written in Lua for using a spinner during a job process.
- This library has been developed on and for Linux following open source philosophy.
Packer
use 'javiorfo/nvim-spinetta'
Lazy
{ 'javiorfo/nvim-spinetta' }
Feature | nvim-spinetta | NOTE |
---|---|---|
Spinners | ✔️ | Includes 6 spinners |
Set your own spinner | ✔️ | |
Set a job | ✔️ | |
Set a another process not only a job | ✔️ | |
start function | ✔️ | Several overloads |
On success option | ✔️ | By the user |
On interruption option | ✔️ | By the user or by an internal error |
- By default the values by parameters are:
{
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:
local spinetta = require'spinetta'
local my_spinner = spinetta:new()
- Second, start the spinner and the job:
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))
- Check the spinners availables in this file
- You can add your own spinner if you like. Further information in
:help spinetta
Examples of the differents spinners included in this plugin. Run :luafile %
in this file
Examples of interruption message included in this plugin. Run :luafile %
and interrupt the process with Ctrl-C
in this file
NOTE: The colorscheme nebula from nvim-nyctophilia is used in this image.
- Bitcoin (QR)
1GqdJ63RDPE4eJKujHi166FAyigvHu5R7v