Add: Completion for todo.txt

Intelligent complete for context and projects, try it ;)
This commit is contained in:
David Beniamine
2015-03-12 21:02:55 -03:00
parent 8c378b5646
commit d3d06926a6
3 changed files with 88 additions and 6 deletions

View File

@@ -31,7 +31,7 @@ COMMANDS *todo-commands*
`date<tab>` : (Insert mode) Insert the current date
`<LocalLeader>-x` : Toggle mark task as done (inserts or remove current date as
`<LocalLeader>-x` : Toggle mark task as done (inserts or remove current date as
completion date)
`<LocalLeader>-X` : Mark all tasks as completed
@@ -56,3 +56,28 @@ g:Todo_txt_second_level_sort_mode="i"
For more information on the available flags see help :sort
We also provide a nice complete function for project and context, to use it
add the following lines to your vimrc:
" Use TodoComplete as the user complete
au filetype todo setlocal completefunc=TodoComplete
You can also start automatically the completion when entering '+' or '@' by
adding the next lines to your vimrc:
" Auto complete projects
au filetype todo imap + +<C-X><C-U>
" Auto complete contexts
au filetype todo imap @ @<C-X><C-U>
===============================================================================
COMPLETION *todo-complete*
The TodoComplete function is designed to complete projects (starting by '+')
and context (starting by '@'). If you use it on a regulard word, it will do a
normal buffer completion.
If you try to complete a project, it will propose all projects in the file and
for each of them, it will show their context in the preview window.
TodoCompelte does the same thing for context except that it gives in the
preview the list of projects existing in each existing contexts.