{"id":20846505,"url":"https://github.com/machakann/vital-schedule","last_synced_at":"2026-05-25T10:31:53.254Z","repository":{"id":71480422,"uuid":"123683010","full_name":"machakann/vital-Schedule","owner":"machakann","description":"Handling tasks","archived":false,"fork":false,"pushed_at":"2018-06-01T12:19:34.000Z","size":40,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-26T21:53:07.528Z","etag":null,"topics":["vim","vim-plugin","vital-vim"],"latest_commit_sha":null,"homepage":null,"language":"Vim script","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/machakann.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-03T10:45:58.000Z","updated_at":"2023-07-25T14:15:27.000Z","dependencies_parsed_at":"2023-02-24T13:15:15.382Z","dependency_job_id":null,"html_url":"https://github.com/machakann/vital-Schedule","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/machakann/vital-Schedule","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/machakann%2Fvital-Schedule","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/machakann%2Fvital-Schedule/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/machakann%2Fvital-Schedule/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/machakann%2Fvital-Schedule/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/machakann","download_url":"https://codeload.github.com/machakann/vital-Schedule/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/machakann%2Fvital-Schedule/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33471517,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-25T06:32:55.349Z","status":"ssl_error","status_checked_at":"2026-05-25T06:32:35.322Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["vim","vim-plugin","vital-vim"],"created_at":"2024-11-18T02:16:42.066Z","updated_at":"2026-05-25T10:31:53.206Z","avatar_url":"https://github.com/machakann.png","language":"Vim script","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vital-Schedule\n\n[![Build Status](https://travis-ci.org/machakann/vital-Schedule.svg)](https://travis-ci.org/machakann/vital-Schedule)\n[![Build status](https://ci.appveyor.com/api/projects/status/dyjxcv4q9n26v0ep?svg=true)](https://ci.appveyor.com/project/machakann/vital-schedule)\n\nHandling auto-command and timer\n\n\n\n## Motivation\n\nWhen I make a vim plugin, I frequently write codes to run a function later. Currently, vim script API gives two choices for the case, that is, auto-command event and timer. However, these measures have quite different interfaces; auto-command events are handled by commands while a timer is controlled by functions. What I want is an easy and unified interface to them.\n\n\n\n## Usage\n\nThis `vital-Schedule` module provides another interface to handle auto-command and timer. It enables us to write complicated scheduled tasks at ease.\n\nFor example, it is a little hassle to run a function only once by using native auto-command interface; the function should unset the auto-command events hooked to by itself.\n\n```vim\nfunction! s:main() abort\n  \" set the autocmd event for s:run_once()\n  augroup example-augroup\n    autocmd!\n    autocmd WinLeave * call s:run_once()\n  augroup END\nendfunction\n\nfunction! s:run_once() abort\n  call s:do_something()\n\n  \" unset the autocmd events\n  augroup example-augroup\n    autocmd! WinLeave\n  augroup END\nendfunction\n\nfunction! s:do_something() abort\n  \" do something here\nendfunction\n```\n\n`Task` object in this module makes the situation simpler. `s:run_once()` is no longer required with it.\n\n```vim\nlet s:Schedule = vital#{pluginname}#new().import('Schedule')\n\nfunction! s:main() abort\n  \" set task\n  let task = s:Schedule.Task()\n  call task.call(function('s:do_something'), [])\n  call task.waitfor(['WinLeave'])\nendfunction\n\nfunction! s:do_something() abort\n  \" do something here\nendfunction\n```\n\nReplace `{pluginname}` with your plugin name. Check [:help vital.vim](https://github.com/vim-jp/vital.vim/blob/master/doc/vital.txt) and [:help Vitalizer](https://github.com/vim-jp/vital.vim/blob/master/doc/vitalizer.txt).\n\nMoreover, it can accept multiple triggers. For example, if you want to run a function after 3000 milliseconds passed or when user starts editing:\n\n```vim\nlet s:Schedule = vital#{pluginname}#new().import('Schedule')\n\nfunction! s:main() abort\n  \" set task\n  let task = s:Schedule.Task()\n  call task.call(function('s:do_something'), [])\n  call task.waitfor([3000, 'TextChanged', 'TextChangedI'])\nendfunction\n\nfunction! s:do_something() abort\n  \" do something here\nendfunction\n```\n\n`s:do_something()` will be triggered by the earliest one in 3000 milliseconds, `TextChanged` or `TextChangedI`.\n\n\n\n## Dependency\n\n - Vim 8.0 or higher.\n - [vital.vim](https://github.com/vim-jp/vital.vim)\n\nThis is an external module of `vital.vim` plugin. Install `vital.vim` and `vital-Schedule`, then use `:Vitalize` command. See [:help Vitalizer](https://github.com/vim-jp/vital.vim/blob/master/doc/vitalizer.txt).\n\n```vim\n:Vitalize --name={pluginname} . Schedule\n```\n\n\n\n## License: NYSL license\n  * [Japanese](http://www.kmonos.net/nysl/)\n  * [English (Unofficial)](http://www.kmonos.net/nysl/index.en.html)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmachakann%2Fvital-schedule","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmachakann%2Fvital-schedule","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmachakann%2Fvital-schedule/lists"}