Package: vimania-todos
vimania-todosModern todo-list management in VIMStore todos from your markdown files in a SQLITE FTS database for centralized management.Key features:todo list management with embedded database, keep your todo items within the context/file where they
belong, but have a centralized view on itno more missing, obsolete or duplicated todosSynchronization of todo status between Markdown files and databasetodo lists within code fences in markdown are ignoredDB entry has a link to the task's source file, so by looking in the DB any Todo can be located.Todos are removed from database when removed from markdown file withddInstallationvim needs to be configured with python supportpipmust be in pathsqliteversion > 3.9.0 for full text search support (FTS5)Installhttps://github.com/sysid/vimania-todoswith your favourite VIM plugin managerInstall pythonrequirements.txtinto<vimplugins>/vimania-todos/pythonxInstall CLI interface:pipx vimania-todosConfigurationUsingvim-plug:Plug'https://github.com/sysid/vimania-todos.git',{'do':'pip install -r pythonx/requirements.txt --target pythonx'}Tested configuration:sqlite 3.36.0 (requires update on macOS)macOS, UbuntuConfigurationvimenia-todosneeds to know, where your Todos database is located:# Default: <vimplugins>/vimania-todos/pythonx/vimania_todos/db/todos.dbexportTW_VIMANIA_DB_URL="sqlite:///$HOME/todos.db"Insert Todos convenience method:I recommend configuring twoUltiSnipssnippets:snippet todo "todo for Vimania"
- [ ] ${1:todo}
endsnippetDependenciesseerequirements.txtOptional:UltiSnipsfor easy uri and todo creationCLI interfacevimaniaprovides a CLI interface with full-text search capabilities to your todo database:vimania-todos-h
vimania-todossearchThe CLI interface is identical to the bookmark-managertwbm.DetailsTodos are recognized via the format:- [ ] todoOn opening Vimania scans the markdown files and updates existing todos with the current state from the databaseOn saving Vimania scans the markdown and saves new or updated todos to the databaseVimania inserts a DB identifier ('%99%') into the markdown item in order to establish a durable link between DB and
markdown itemThe identifier is hidden via VIM'sconcealfeaturetodo items are deleted by deleting (dd) in normal mode. This triggers a DB updatetodo items deleted byddin visual mode are NOT delete from DB. This is useful to move tasks from one file to
another. Otherwise, you always can move an item by just deleting it in one file and paste in to another file AND then
remove the database id ('%99%'). So Vimania kust creates a new entry/link.Example todo fileAfter saving the file, the identifiers have been added and the items are saved in DB:-%1% [ ] purchase piano -%2% [ ] [AIMMS book](file:~/dev/pyomo/tutorial/AIMMS_modeling.pdf)
-%7% [ ] list repos ahead/behind remoteCaveatDeleting markdown todo items outside Vimenia will cause inconsistency between the DB and the markdown state.Always useddto delete a markdown item in order to trigger the corresponding DB updateNever change the identifier '%99%' manually.Todo items are always synced from the DB when opening a markdown file, so changes not written back to DB will be
lost.Markdown content other than todo items can be changed arbitrarily, of course.Fixing inconsistent stateTodos in markdown can get out of sync if updates are made outside of vim, e.g. with another text editor. Don't worry,
this can be fixed easily.entry already in DBfind the corresponding id in the DBadd the id to the markdown item:-%99% [ ] markdown itementry in DB but not in markdownyou can safely delete the entry in the DB, unless you maintain on purpose todo items in the DB which do not have a
counterpart in a markdown (I do).Resetting everything (advanced)Deleting/adding todo items outside the control of Vimania can cause an inconsistent state between the database on the
markdown files. It is possible to re-synchronize the DB and the todo-lists by creating a new database and clearing the
todo items fo their identifier:Reset DB:cd pythonx/vimania-todos/db; rm todos.db; alembic upgrade headClean up existing markdown files:find all affected markdown files:rg -t md -- '-%\d+%'edit the markdown files and remove the allocated database-id to allow for
re-init:sed -i 's/-%[0-9]\+%/-/' todo.mdVimania DevelopmentVIM needs to find vimania dependencies inpythonx.VIM Interfacecannot be tested within PyCharm, needs to be called from VIM.For python changes it is important to restart vim after every change in order to enforce proper reload:
this is best automated with a Vader script:run_tests.sh testfilein tests directory.vimscript changes can be reloaded as usualTestingPython: pytestmake testVIM: Vadermake test-vimSmoke Testafter installation withPlugrun vader testsArchitectureCreditsIt is inspired by and recommends to useUltiSnips.DB management is based onjarun/bukuChangelogCHANGELOG.mdThe MIT License (MIT)Copyright (c) 2022 sysidPermission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.