Code Monkey home page Code Monkey logo

vim-todo-lists's Introduction

vim-todo-lists

vim-todo-lists is a Vim plugin for TODO lists management.

Installation

Install vim-todo-lists

Pathogen
$ cd ~/.vim/bundle
$ git clone https://github.com/aserebryakov/vim-todo-lists.git
NeoBundle
NeoBundle 'aserebryakov/vim-todo-lists'
Without plugin manager

Clone or download this repository and copy its contents to your ~/.vim/ directory.

Usage

Plugin is automatically applied for files with .todo.md extension.

TODO Items

The following example represents TODO items definition by default.

Example
- [ ] Not done
- [X] Done
Custom Configuration

You can customize the representation of the item by defining the following variables to your .vimrc

let g:VimTodoListsUndoneItem = '- [X]'
let g:VimTodoListsDoneItem = '- [V]'
Important Item

Important item is defined as undone item string !.

- [ ] ! Important item
Items Hierarchy

If one item has lesser indentation than the next one then the first one is meant to be parent and the second to be child.

Example
- [ ] Parent
  - [ ] Child1
  - [ ] Child2
Rules:
  • Changing state of the parent item changes the state of all children items accordantly
  • If all children items are marked done, parent will also be marked as done
  • If parent is marked as done and one of the children changes state to not done parent will also be marked as not done
Items Highlighting

Items are highlighted in accordance to the following scheme:

- [ ] ! Important item (Underlined)
- [ ] Normal item (Normal)
- [X] Done item (Comment)
Items moving on state change

By default item when its status is changed is moved in the list in accordance to the following rules

Mark item done

Item marked as done is moved to the end of all done items list. If done list doesn't exist, item is placed just after the last not done item.

Before

- [ ] Not Done 1
- [ ] Will be done now
- [ ] Not Done 2
- [X] Done

After

- [ ] Not Done 1
- [ ] Not Done 2
- [X] Done
- [X] Will be done now
Mark item undone

Undone item is moved to the end of all not done items list. If all items are marked done, the items is moved before the first done item.

Before

- [ ] Not Done 1
- [ ] Not Done 2
- [X] Done
- [X] Will be undone now

After

- [ ] Not Done 1
- [ ] Not Done 2
- [ ] Will be done now
- [X] Done
Interaction with items hierarchy

This feature also affect the items in hierarchy in accordance to the rules above.

Disable the items moving

If you don't want items to be moved after state change, you may add the following line into your .vimrc file:

let g:VimTodoListsMoveItems = 0
Commands
  • :VimTodoListsCreateNewItemAbove - creates a new item in a line above cursor
  • :VimTodoListsCreateNewItemBelow - creates a new item in a line below cursor
  • :VimTodoListsCreateNewItem - creates a new item in current line
  • :VimTodoListsGoToNextItem - go to the next item
  • :VimTodoListsGoToPreviousItem - go to the previous item
  • :VimTodoListsToggleItem - toggles the current item (or selected items in visual mode)
  • :VimTodoListsIncreaseIndent - increases the indent of current line
  • :VimTodoListsDecreaseIndent - decreases the indent of current line
Default key mappings
Item editing mode
  • j - go to next item
  • k - go to previous item
  • O - create new item above the cursor
  • o - create new item below the cursor
  • <Space> - toggle current item
  • <CR> - create new item in insert mode
  • <Tab> - increases the indent of current (or selected) line(s)
  • <Shift-Tab> - decreases the indent of current (or selected) line(s)
  • <leader>e - switch to normal editing mode
Normal editing mode
  • j, k, o, O, <CR> - no special behavior
  • <Space> - toggle current item
  • <leader>e - switch to item editing mode
Custom key mappings

The g:VimTodoListsCustomKeyMapper variable should contain a name of the function implementing custom mappings.

Example
let g:VimTodoListsCustomKeyMapper = 'VimTodoListsCustomMappings'

function! VimTodoListsCustomMappings()
  nnoremap <buffer> s :VimTodoListsToggleItem<CR>
  nnoremap <buffer> <Space> :VimTodoListsToggleItem<CR>
  noremap <buffer> <leader>e :silent call VimTodoListsSetItemMode()<CR>
endfunction
Automatic date insertion

Automatic date insertion may be enabled by setting the following in .vimrc:

let g:VimTodoListsDatesEnabled = 1

Date format may be changed by setting the format variable to a valid strftime() string:

let g:VimTodoListsDatesFormat = "%a %b, %Y"

Contribution

Source code and issues are hosted on GitHub:

https://github.com/aserebryakov/vim-todo-lists

If you are going to make a pull request, you should use dev branch for functionality implementation to simplify the merge procedure.

License

MIT License

Changelog

0.8.0

Breaking Change

  • Added option to configure TODO items
  • File extension changed to .todo.md from .todo
  • Item indentation level is kept when creating a new one
  • Removed migration from older formats
  • Added plugin initialization for todo filetype
  • New item can be created with keypad Enter key
  • Makes normal mode keys more consistent

0.7.1

  • Syntax highlight is fixed

0.7.0

  • Added automatic date insertion feature
  • Added mappings for fast increasing/decreasing indent
  • Items list are made markdown compatible (old files are updated automatically on load)

0.6.0

  • Added items moving on state change

0.5.1

  • Fixed the annoying noise when navigating over items in default mode
  • Fixed the cursor position after the item is toggled

0.5.0

  • Added items highlighting

0.4.0

  • Added items hierarchy support

0.3.0

  • Added items toggling in visual mode
  • Improves work with indentations of list items
  • Fixed the error when trying to navigate the buffer that doesn't contain items

0.2.0

  • Added an option to configure custom key mappings

0.1.1

  • Fixes broken compatibility with the filestyle plugin

0.1.0

  • Navigation in TODO list
  • Adding new items
  • Items toggling

Contributors

  • Alexander Serebryakov, author (GitHub)
  • Jake Mason, contributor (GitHub)
  • Alexandr Kondratev, contributor (GitHub)
  • Jannis Jorre, contributor (GitHub)
  • thehunmonkgroup, contributor (GitHub)
  • Suchandra Thapa, contributor (GitHub)

vim-todo-lists's People

Contributors

aserebryakov avatar black-cat avatar jakemason avatar jeyj0 avatar qkombur avatar sthapa avatar theg4sh avatar thehunmonkgroup avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vim-todo-lists's Issues

Automatically add dates for new list items and these that are done

I like the vim-todo-lists plugin. The way I started using it, I noticed that I always add dates when I add a new item and the date when I check an item to be completed. I would be nice to have these added automatically, e.g.:

  1. when a new item is added, add "{added on d1.m1.yyyy}" at the end of the new line
  2. when an item is checked to be done, add "{completed d2.m2.yyyy}" at the end of the line, or, if there is already "{added on " in that line, replace this with "{completed " and the last "}" with " to d2.m2.yyyy}" to read "{completed d1.m1.yyyy to d2.m2.yyyy}"

where d1.m1.yyyy and d2.m2.yyyy are the current dates, d1.m1. for a new line and d2.m2. for a task that is completed.

incorrect indentation when adding items above or below

Great plugin. My only problem is that when I am in item editing mode, o and O insert a new item below/above the current line, but the indentation is one level deeper, instead of at the same level as the current line as I would expect.

Also, when in both modes, pressing enter at the end of an item creates a new item at the left most level (2 spaces) regardless of how far the current line is intended.

I am not sure if this has to do with my shiftwidth/tabstop settings. I have tried to set them correctly, and they seem to work as expected when I am in normal edit mode.

Has anyone else ran into this issue? Any ideas?

Thanks!!

Using blockquotes between items breaks list

Hello,

i'm using mardown blockquote to comment actions or evolutions on the todo items, for examle :

- [ ] Incident Apps1 Vlan X
  - [X] Action X / Modification confi Ipv6
  > 20210322
    >> toujours présent

  > 20210323
    >> Analyse du 33 ; proposition de sorti des serveurs impactés de production
    >> Chercher entre 33 (surtout) + 35 (28/02) / et les autres
    >> Difference configuration pour urandom Java
    >> Chemin réseau
    >> Système / différence de configuration

  > 20210329
    >> Changement de chassis pour la lame 33
  - [ ] Traitement Ok
  - [X] Changement de chassis lame 33
- [ ] Evolution Apps2

Is there a way to prevent blockquotes and other block element to break todo lists ?

Parent and child todo list issue

Hello!

I have testing your plugin and I like it! I found a little issue.

When you have a Parent list and a couple of child tasks if you mark both as done the Parent is marked as done, that's right. But if now you add a third Child, the Parent keeps been marked as done. Should be automatically be Undone... (IMHO)

The same feature should be if you have 3 Child tasks, 2 done and 1 undone. The Parent is Undone. Ok. But if you delete the Child that is Undone, the Parent should be Done...

Sorry for this mess of Child, Parents, done and undone tasks!! :)

Move toggled items to the end of the list

Mark done

Item marked as done is moved to the end of all done items list.
If done list doesn't exist, item is placed just after the last not done item.

Before

[ ] Not Done 1
[ ] Will be done now
[ ] Not Done 2
[X] Done

After

[ ] Not Done 1
[ ] Not Done 2
[X] Done
[X] Will be done now

Mark undone

Undone item is moved to the end of all not done items list.
If all items are marked done, the items is moved before the first done item.
Before

[ ] Not Done 1
[ ] Not Done 2
[X] Done
[X] Will be undone now

After

[ ] Not Done 1
[ ] Not Done 2
[ ] Will be done now
[X] Done

Additional Requirements

  • Moving items should keep the hierarchy
  • The option to disable the feature should be provided

How to uninstall vim-todo-lists?

I don't know how to uninstall this plugin.

mac 10.14.3
Term
junegunn/vim-plug

Show me follow error when I press "o" after uninstall aserebryakov/vim-todo-lists with junegunn/vim-plug in mac 10.14.3 systerm.

E492: Not an editor command VimTodoListsCreateNewItemBelow

Autocommand nesting too deep issue

I just downloaded and started using this plugin today. This is a pretty slick plugin, and I think I'll be getting a lot of use out of it, so thanks!

When I started using this plugin, I would get this annoying warning that Autocommands were nested too deep. It doesn't seem to cause a major issues, but it drives OCD people like me crazy :)

Looking through the plugin, I can see where you set an auto command for "FileType todo" to call the VimTodoListsInit function. In the VimTodoListsInit function the first line issues a "set filetype=todo", creating the infinite loop that triggers the autocommand nesting error.

I fixed this in my local plugin with a quick and dirty hack (probably not the best way to do it, but it works for me) by:

  1. Rename the VimTodoListsInit function to VimTodoListsPostInit
  2. Delete the "set filetype=todo" from the VimTodoListPostsInit function
  3. Create a new function named VimTodoListsInit that ONLY sets filetype=todo
  4. Change the "autocmd FileType todo call VimTodoListsInit" to call VimTodoListsPostInit

I'm sure there is a better way to fix this, but please find my work around attached.
vim-todo-lists.txt

work with normal markdown files

can this work with file.md instead of file.todo.md, is the filename pattern a mandatory requirement?

it would be nice to insert todo list into regular named markdown files

Items hierarchy support

Items hierarchy support:

[ ] Parent
  [ ] Child 1
  [ ] Child 2

If all children are marked as done, parent also should be marked as done.

If parent is marked as done, children also should be marked as done.

Fix the interaction between marking range of the items and items hierarchy

Scenario

[ ] Parent
  [ ] Child
  [ ] Child

If all items are selected then state will not change because toggling will be applied sequentially for all items so it will cause setting all items on Parent and then resetting each of Child items.

The proposed behavior in this case is to set Parent and do not change Child items after that.

Using vim-plug

First of all thanks for the plugin.

When I try to use it via vim-plug as following:

Plug 'aserebryakov/vim-todo-lists', { 'for': 'todo' }

It doesn't seem to work even though I did configure filetype correctly:

autocmd BufRead,BufNewFile *.todo set ft=todo

It does work if I add call VimTodoListsInit:

autocmd BufRead,BufNewFile *.todo set ft=todo | call VimTodoListsInit()

but I find this solution a bit of a hack.

TODO lists management

The following functionality should be implemented:

  • Set TODO lists directory
  • Create new TODO list
  • Delete TODO list
  • Archive TODO list
  • List the archive
  • Open list from archive

Swap o and O commands

To more model how normal vim works "O" would insert a line above while this program does it opposite, consider changing to more closely model vim?

Add mappings for item hiearchy handling

It would be very useful to add mappings for more convenient items hierarchy control e.g. TAB to increase indentation level and SHIFT + TAB to decrease indentation level.

Unmap <CR> in normal mode

Thank you for very cool plugin.

My issue: if you switch from item mode to normal mode, than the <CR> mapping stays mapped

inoremap <buffer> <CR> ...

Consequence: wenn pressing enter in insert mode, "- [ ]" get inserted. In item mode it's cool, but in normal mode it's not as cool, since you probably doing some clean ups at this moment and is not interested in adding new tasks (this is, why I'm switching to the normal mode, at least).

Another reason to fix this: pressing o and O in normal mode doesn't add new tasks. So it's at least not consistent ;)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.