Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
41a75a8f50 | ||
|
|
f3a3bdbefb | ||
|
|
3089527c71 | ||
|
|
7fdf0427a8 | ||
|
|
644b6d6628 | ||
|
|
d3b011b718 |
303
README.markdown
303
README.markdown
@@ -1,22 +1,94 @@
|
||||
# Readme
|
||||
# Todo.txt-vim
|
||||
|
||||
**Note:** Since v0.7.3, `TodoComplete` is `todo#Complete`, you might need to
|
||||
update your vimrc.
|
||||
##### # #
|
||||
# #### ##### #### ##### # # ##### # # # # #
|
||||
# # # # # # # # # # # # # # ## ##
|
||||
# # # # # # # # ## # ### # # # # ## #
|
||||
# # # # # # # # ## # # # # # #
|
||||
# # # # # # # ## # # # # # # # # #
|
||||
# #### ##### #### ## # # # # # # # #
|
||||
|
||||
## What is this plugin ?
|
||||
Efficient Todo.txt management in vim
|
||||
|
||||
## Table of Contents
|
||||
|
||||
1. [Release notes](#release-notes)
|
||||
2. [Introduction](#introduction)
|
||||
1. [Todo.txt rules](#todo.txt-rules)
|
||||
2. [Why this Fork ?](#Why-this-fork)
|
||||
3. [Installation](#installation)
|
||||
3. [TodoTxt Files](#todotxt-files)
|
||||
4. [Completion](#completion)
|
||||
5. [Hierarchical Sort](#hierarchical-sort)
|
||||
6. [Mappings](#mappings)
|
||||
1. [Sort](#sort)
|
||||
2. [Priorities](#priorities)
|
||||
3. [Dates](#dates)
|
||||
4. [Done](#done)
|
||||
|
||||
## Release notes
|
||||
|
||||
Since v0.7.3, `TodoComplete` is replaced by `todo#Complete`, you might need to
|
||||
update your vimrc (see [completion](#completion)).
|
||||
|
||||
## Introduction
|
||||
|
||||
Todo.txt-vim is a plugin to manage todo.txt files it was initially designed by
|
||||
[Freitass](https://github.com/freitass/todo.txt-vim) then forked and improved
|
||||
by David Beniamine.
|
||||
|
||||
### Todo.txt rules
|
||||
|
||||
Todo.txt is a standard human readable todo notes file defined [here](http://todotxt.com):
|
||||
|
||||
"The todo.txt format is a simple set of
|
||||
[rules](https://github.com/ginatrapani/todo.txt-cli/wiki/The-Todo.txt-Format)
|
||||
that make todo.txt both human and machine-readable. The format supports
|
||||
priorities, creation and completion dates, projects and contexts. That's
|
||||
all you need to be productive. See an example Todo.txt file":
|
||||
|
||||
(A) Call Mom @Phone +Family
|
||||
(A) Schedule annual checkup +Health
|
||||
(B) Outline chapter 5 +FamilyNovel @Computer
|
||||
(C) Add cover sheets @ComputerOffice +FamilyTPSReports
|
||||
Plan backyard herb garden @ComputerHome
|
||||
Pick up milk @ComputerGroceryStore
|
||||
Research self-publishing services +FamilyNovel @ComputerComputer
|
||||
x Download Todo.txt mobile app @ComputerPhone
|
||||
|
||||
### Why this fork ?
|
||||
|
||||
This plugin is a fork of [freitass
|
||||
todo.txt](https://github.com/freitass/todo.txt-vim). It add severals
|
||||
functionalities including a [hierarchical sort](#sort), a
|
||||
[complete](#completion) function, some stuff to handle [due
|
||||
dates](#due-dates), a more [flexible file naming](#flexible-file-naming), and
|
||||
others stuff see [new features](#new-features).
|
||||
todo.txt-vim](https://github.com/freitass/todo.txt-vim). It add severals cool
|
||||
functionalities including:
|
||||
|
||||
Freitass announced on october 30th 2014 that he is not going to merge his version.
|
||||
+ [Hierarchical sort](##hierarchical-sort)
|
||||
+ [A completion function](#completion)
|
||||
+ [A proper handling of due dates](#dates)
|
||||
+ [A Flexible file naming](#todotxt-files).
|
||||
+ Syntax Highlight for couples key:value.
|
||||
+ `<LocalLeader>x` is a toggle which allow you to unmark a task as done.
|
||||
+ `<LocalLeader>C` Toggle Mark a task cancelled
|
||||
+ If the current buffer is a done.txt file, the basic sort sorts on
|
||||
completion date.
|
||||
+ ...
|
||||
|
||||
## Install
|
||||
### Installation
|
||||
|
||||
### Quick install
|
||||
#### Vizardry
|
||||
|
||||
If you have [Vizardry](https://github.com/dbeniamine/vizardry) installed,
|
||||
you can run from vim:
|
||||
|
||||
:Invoke -u dbeniamine todo.txt-vim
|
||||
|
||||
#### Pathogen install
|
||||
|
||||
git clone https://github.com/dbeniamine/todo.txt-vim.git ~/.vim/bundle/todo.txt-vim
|
||||
|
||||
Then from vim: `:Helptags` to update the doc
|
||||
|
||||
#### Quick install
|
||||
|
||||
git clone https://github.com/dbeniamine/todo.txt-vim.git
|
||||
cd todo.txt-vim
|
||||
@@ -27,105 +99,7 @@ If you want the help installed, run `:helptags ~/.vim/doc` inside vim after
|
||||
having copied the files. Then you will be able to get the commands help with:
|
||||
`:h todo.txt`
|
||||
|
||||
### Pathogen install
|
||||
|
||||
git clone https://github.com/dbeniamine/todo.txt-vim.git ~/.vim/bundle/todo.txt-vim
|
||||
|
||||
Then from vim: `:Helptags` to update the doc
|
||||
|
||||
## Features included in Freitass version
|
||||
|
||||
This plugin gives syntax highlighting to [todo.txt](http://todotxt.com/) files. It also defines a few mappings, to help with editing these files:
|
||||
|
||||
`<LocalLeader>s` : Sort the file
|
||||
|
||||
`<LocalLeader>s+` : Sort the file on +Projects
|
||||
|
||||
`<LocalLeader>s@` : Sort the file on @Contexts
|
||||
|
||||
`<LocalLeader>j` : Lower the priority of the current line
|
||||
|
||||
`<LocalLeader>k` : Increase the priority of the current line
|
||||
|
||||
`<LocalLeader>a` : Add the priority (A) to the current line
|
||||
|
||||
`<LocalLeader>b` : Add the priority (B) to the current line
|
||||
|
||||
`<LocalLeader>c` : Add the priority (C) to the current line
|
||||
|
||||
`<LocalLeader>d` : Insert the current date
|
||||
|
||||
`date<tab>` : (Insert mode) Insert the current date
|
||||
|
||||
`<LocalLeader>x` : Toggle mark task as done (inserts current date as completion date)
|
||||
|
||||
`<LocalLeader>X` : Mark all tasks as completed
|
||||
|
||||
`<leader>-D` : Move completed tasks to done.txt
|
||||
|
||||
## New features
|
||||
|
||||
### Sort
|
||||
|
||||
This fork provides a hierarchical sorting function designed to do by project
|
||||
and/or by context sorts and a priority sort.
|
||||
|
||||
`<LocalLeader>sc` : Sort the file by context then by priority
|
||||
`<LocalLeader>scp` : Sort the file by context, project then by priority
|
||||
`<LocalLeader>sp` : Sort the file by project then by priority
|
||||
`<LocalLeader>spc` : Sort the file by project, context then by priority
|
||||
|
||||
The user can give argument for the two call to vim sort function by changing
|
||||
the following variables in its vimrc:
|
||||
see :help sort
|
||||
let g:Todo_txt_first_level_sort_mode="! i"
|
||||
let g:Todo_txt_second_level_sort_mode="i"
|
||||
|
||||
### Completion
|
||||
|
||||
We also provide a nice complete function for project and context, to use it
|
||||
add the following lines to your vimrc:
|
||||
|
||||
" Use todo#complete as the omni complete function for todo files
|
||||
au filetype todo setlocal omnifunc=todo#complete
|
||||
|
||||
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 <buffer> + +<C-X><C-O>
|
||||
|
||||
" Auto complete contexts
|
||||
au filetype todo imap <buffer> @ @<C-X><C-O>
|
||||
|
||||
The `todo#complete` function is designed to complete projects (starting by '+')
|
||||
and context (starting by '@'). If you use it on a regular word, it will do a
|
||||
normal keyword completion (on all buffers).
|
||||
If you try to complete a project, it will propose all projects in all open
|
||||
buffers and for each of them, it will show their context and the name of the
|
||||
buffers in which they appears 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.
|
||||
|
||||
### Due dates
|
||||
|
||||
I've integrated the [work from
|
||||
durcheinandr](https://github.com/durcheinandr/todo.txt-vim/) concerning due
|
||||
dates + some little improvements:
|
||||
|
||||
Accorrding to the todo.txt rules, one can define due dates using `due:date` or
|
||||
`DUE:date` or any other `key:value` combination. This plugins handle dates at
|
||||
the format `YYYY-MM-DD` and the key `due` can be spell using any combination
|
||||
of lower and upper case letters. The following mappings are provided:
|
||||
|
||||
`<leader>-sd` : Sort the file by due-date. Entries with a due date appears
|
||||
sorted by at the beginning of the file, the rest of the file is not modified.
|
||||
|
||||
`due:` : (Insert mode) Insert `due:` followed by the current date
|
||||
|
||||
`DUE:` : (Insert mode) Insert `DUE:` followed by the current date
|
||||
|
||||
### Flexible File naming
|
||||
## TodoTxt Files
|
||||
|
||||
This plugin provides a Flexible file naming for todo.txt, all the following
|
||||
names are recognized as todo:
|
||||
@@ -146,18 +120,111 @@ And obviously the same are recognize as done:
|
||||
[Dd]one.txt
|
||||
[Dd]one-[Tt]oday.txt
|
||||
|
||||
Moreover, remove complete tasks `<LocalLeader>D` moves the task to the
|
||||
done.txt file corresponding to the current todo.txt, aka if you are editing
|
||||
Moreover, `<LocalLeader>D` moves the task under the cursor to the done.txt
|
||||
file corresponding to the current todo.txt, aka if you are editing
|
||||
2015-07-07-todo.txt, the done file while be 2015-07-07-done.txt. If you don't
|
||||
like this behavior, you can set the default done.txt name:
|
||||
|
||||
let g:TodoTxtForceDoneName='done.txt'
|
||||
|
||||
### Others
|
||||
## Completion
|
||||
|
||||
`<LocalLeader>x` is a toggle which allow you to unmark a task as done.
|
||||
This plugin provides a nice complete function for project and context, to use
|
||||
it add the following lines to your vimrc:
|
||||
|
||||
Syntax highlighting for couples key:value
|
||||
" Use todo#complete as the omni complete function for todo files
|
||||
au filetype todo setlocal omnifunc=todo#complete
|
||||
|
||||
If the current buffer is a done.txt file, the basic sort sorts on completion
|
||||
date.
|
||||
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 <buffer> + +<C-X><C-O>
|
||||
|
||||
" Auto complete contexts
|
||||
au filetype todo imap <buffer> @ @<C-X><C-O>
|
||||
|
||||
|
||||
The `todo#complete` function is designed to complete projects (starting by `+`)
|
||||
and context (starting by `@`). If you use it on a regular word, it will do a
|
||||
normal keyword completion (on all buffers).
|
||||
|
||||
If you try to complete a project, it will propose all projects in all open
|
||||
buffers and for each of them, it will show their context and the name of the
|
||||
buffers in which they appears in the preview window. It does the same thing
|
||||
for context except that it gives in the preview the list of projects existing
|
||||
in each existing contexts.
|
||||
|
||||
## Hierarchical sort
|
||||
|
||||
This fork provides a hierarchical sorting function designed to do by project
|
||||
and/or by context sorts and a priority sort.
|
||||
|
||||
`<LocalLeader>sc` : Sort the file by context then by priority
|
||||
`<LocalLeader>scp` : Sort the file by context, project then by priority
|
||||
`<LocalLeader>sp` : Sort the file by project then by priority
|
||||
`<LocalLeader>spc` : Sort the file by project, context then by priority
|
||||
|
||||
The user can give argument for the two calls to vim sort function by changing
|
||||
the following variables:
|
||||
|
||||
g:Todo_txt_first_level_sort_mode
|
||||
g:Todo_txt_second_level_sort_mode
|
||||
|
||||
Defaults values are:
|
||||
|
||||
|
||||
g:Todo_txt_first_level_sort_mode="i"
|
||||
g:Todo_txt_second_level_sort_mode="i"
|
||||
|
||||
|
||||
For more information on the available flags see `help :sort`
|
||||
|
||||
## Mappings
|
||||
|
||||
By default todo-txt.vim set all the mappings secribed in this section. To
|
||||
prevent this behavior, add the following line to your vimrc
|
||||
|
||||
let g:Todo_txt_do_not_map=1
|
||||
|
||||
|
||||
|
||||
`<LocalLeader>` is \ by default, so ̀`<LocaLeader>-s` means you type \s
|
||||
|
||||
### Sort
|
||||
|
||||
+ `<LocalLeader>s` : Sort the file by priority
|
||||
+ `<LocalLeader>s+` : Sort the file on `+Projects`
|
||||
+ `<LocalLeader>s@` : Sort the file on `@Contexts`
|
||||
+ `<LocalLeader>s@` : Sort the file on due dates
|
||||
+ `<LocalLeader>sc` : Sort the file by context then by priority
|
||||
+ `<LocalLeader>scp` : Sort the file by context, project then by priority
|
||||
+ `<LocalLeader>sp` : Sort the file by project then by priority
|
||||
+ `<LocalLeader>spc` : Sort the file by project, context then by priority
|
||||
+ `<leader>-sd` : Sort the file by due-date. Entries with a due date appears
|
||||
sorted by at the beginning of the file, the rest of the file is not modified.
|
||||
|
||||
### Priorities
|
||||
|
||||
+ `<LocalLeader>j` : Lower the priority of the current line
|
||||
+ `<LocalLeader>k` : Increase the priority of the current line
|
||||
+ `<LocalLeader>a` : Add the priority (A) to the current line
|
||||
+ `<LocalLeader>b` : Add the priority (B) to the current line
|
||||
+ `<LocalLeader>c` : Add the priority (C) to the current line
|
||||
|
||||
### Dates
|
||||
|
||||
+ `<LocalLeader>d` : Insert the current date
|
||||
+ `date<tab>` : (Insert mode) Insert the current date
|
||||
+ `due:` : (Insert mode) Insert `due:` followed by the current date
|
||||
+ `DUE:` : (Insert mode) Insert `DUE:` followed by the current date
|
||||
|
||||
### Done
|
||||
|
||||
|
||||
+ `<LocalLeader>x` : Toggle mark task as done (inserts or remove current
|
||||
+ date as completion date)
|
||||
+ `<LocalLeader>C` : Toggle mark task cancelled
|
||||
+ `<LocalLeader>X` : Mark all tasks as completed
|
||||
+ `<LocalLeader>D` : Move completed tasks to done file, see [TodoTxt
|
||||
Files](#todotxt-files)
|
||||
|
||||
@@ -58,25 +58,33 @@ function! todo#PrependDate()
|
||||
normal! 0"=strftime("%Y-%m-%d ")
|
||||
P
|
||||
endfunction
|
||||
|
||||
|
||||
function! todo#ToggleMarkAsDone(status)
|
||||
if (getline(".") =~ 'x\s*\d\{4\}')
|
||||
if (getline(".") =~ 'x\s*\d\{4\}')
|
||||
:call todo#UnMarkAsDone(a:status)
|
||||
else
|
||||
else
|
||||
:call todo#MarkAsDone(a:status)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! todo#UnMarkAsDone()
|
||||
|
||||
function! todo#UnMarkAsDone(status)
|
||||
if a:status==''
|
||||
let pat=''
|
||||
else
|
||||
let pat=' '.a:status
|
||||
endif
|
||||
exec ':s/\s*x\s*\d\{4}-\d\{1,2}-\d\{1,2}'.pat.'\s*//g'
|
||||
endfunction
|
||||
|
||||
|
||||
function! todo#MarkAsDone(status)
|
||||
if a:status!=''
|
||||
exec 'normal! I'.a:status.' '
|
||||
endif
|
||||
call todo#PrependDate()
|
||||
normal! Ix
|
||||
endfunction
|
||||
|
||||
function! todo#MarkAllAsDone()
|
||||
function! todo#MarkAllAsDone()
|
||||
:g!/^x /:call todo#MarkAsDone('')
|
||||
endfunction
|
||||
|
||||
|
||||
319
doc/todo.txt
319
doc/todo.txt
@@ -1,112 +1,111 @@
|
||||
*todo.txt*
|
||||
*Todo.txt-vim*
|
||||
|
||||
Note: Since v0.7.3, `TodoComplete` is `todo#Complete`, you might need to
|
||||
update your vimrc.
|
||||
##### # #
|
||||
# #### ##### #### ##### # # ##### # # # # #
|
||||
# # # # # # # # # # # # # # ## ##
|
||||
# # # # # # # # ## # ### # # # # ## #
|
||||
# # # # # # # # ## # # # # # #
|
||||
# # # # # # # ## # # # # # # # # #
|
||||
# #### ##### #### ## # # # # # # # #
|
||||
|
||||
==============================================================================
|
||||
COMMANDS *todo-commands*
|
||||
Efficient Todo.txt management in vim
|
||||
|
||||
`<LocalLeader>s` : Sort the file by priority
|
||||
|
||||
`<LocalLeader>s+` : Sort the file on +Projects
|
||||
|
||||
`<LocalLeader>s@` : Sort the file on @Contexts
|
||||
|
||||
`<LocalLeader>s@` : Sort the file on due dates
|
||||
|
||||
`<LocalLeader>sc` : Sort the file by context then by priority
|
||||
|
||||
`<LocalLeader>scp` : Sort the file by context, project then by priority
|
||||
|
||||
`<LocalLeader>sp` : Sort the file by project then by priority
|
||||
|
||||
`<LocalLeader>spc` : Sort the file by project, context then by priority
|
||||
|
||||
`<leader>-sd` : Sort the file by due-date. Entries with a due date appears
|
||||
sorted by at the beginning of the file, the rest of the file is not modified.
|
||||
|
||||
`<LocalLeader>j` : Lower the priority of the current line
|
||||
|
||||
`<LocalLeader>k` : Increase the priority of the current line
|
||||
|
||||
`<LocalLeader>a` : Add the priority (A) to the current line
|
||||
|
||||
`<LocalLeader>b` : Add the priority (B) to the current line
|
||||
|
||||
`<LocalLeader>c` : Add the priority (C) to the current line
|
||||
|
||||
`<LocalLeader>d` : Insert the current date
|
||||
|
||||
`date<tab>` : (Insert mode) Insert the current date
|
||||
|
||||
`due:` : (Insert mode) Insert `due:` followed by the current date
|
||||
|
||||
`DUE:` : (Insert mode) Insert `DUE:` followed by the current date
|
||||
|
||||
`<LocalLeader>x` : Toggle mark task as done (inserts or remove current date as
|
||||
completion date)
|
||||
|
||||
`<LocalLeader>X` : Mark all tasks as completed
|
||||
|
||||
`<LocalLeader>D` : Move completed tasks to done file, see |todo-flexibleFileNaming|
|
||||
|
||||
`<LocalLeader>` is \ by default, so ̀`<LocaLeader>-s` means you type \s
|
||||
|
||||
===============================================================================
|
||||
CONFIGURATION *todo-configuration*
|
||||
Table of Contents *TodoTxt-Contents* ~
|
||||
|
||||
The user can give argument for the two calls to vim sort function by changing
|
||||
the following variables:
|
||||
|
||||
g:Todo_txt_first_level_sort_mode
|
||||
g:Todo_txt_second_level_sort_mode
|
||||
|
||||
Defaults values are:
|
||||
|
||||
>
|
||||
g:Todo_txt_first_level_sort_mode="i"
|
||||
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 todo#Completete as the omni complete for todo files
|
||||
au filetype todo setlocal omnifunc=todo#Complete
|
||||
<
|
||||
|
||||
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 <buffer> + +<C-X><C-O>
|
||||
|
||||
" Auto complete contexts
|
||||
au filetype todo imap <buffer> @ @<C-X><C-O>
|
||||
<
|
||||
To force completed task to be moved to a file independently from the current
|
||||
file name, add the following to your vimrc:
|
||||
>
|
||||
let g:TodoTxtForceDoneName='done.txt'
|
||||
<
|
||||
For more explanations, see |todo-flexibleFileNaming|
|
||||
1. Release notes.................................|TodoTxt-ReleaseNotes|
|
||||
2. Introduction..................................|TodoTxt-Introduction|
|
||||
2.1 Todo.txt rules...........................|TodoTxt-Rules|
|
||||
2.2 Why this Fork............................|TodoTxt-Fork|
|
||||
2.3 Installation.............................|TodoTxt-Installation|
|
||||
3. TodoTxt Files.................................|TodoTxt-Files|
|
||||
4. Completion....................................|TodoTxt-Completion|
|
||||
5. Hierarchical Sort.............................|TodoTxt-HierarchicalSort|
|
||||
6. Mappings......................................|TodoTxt-Mappings|
|
||||
6.1 Sort.....................................|TodoTxt-Sort|
|
||||
6.2 Priorities...............................|TodoTxt-Priorities|
|
||||
6.3 Dates....................................|TodoTxt-Dates|
|
||||
6.4 Done.txt.................................|TodoTxt-Done|
|
||||
|
||||
===============================================================================
|
||||
COMPLETION *todo-complete*
|
||||
1. Release notes *TodoTxt-ReleaseNotes* ~
|
||||
|
||||
The `todo#Complete`te function is designed to complete projects (starting by '+')
|
||||
and context (starting by '@'). If you use it on a regular word, it will do a
|
||||
normal keyword completion (on all buffers).
|
||||
If you try to complete a project, it will propose all projects in all open
|
||||
buffers and for each of them, it will show their context and the name of the
|
||||
buffers in which they appears 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.
|
||||
Since v0.7.3, `TodoComplete` is replaced by `todo#Complete`, you might need to
|
||||
update your vimrc (see |TodoTxt-Completion|).
|
||||
|
||||
===============================================================================
|
||||
FLEXIBLE FILE NAMING *todo-flexibleFileNaming*
|
||||
2. Introduction *TodoTxt-Introduction* ~
|
||||
|
||||
Todo.txt-vim is a plugin to manage todo.txt files it was initially designed by
|
||||
Freitass (https://github.com/freitass/todo.txt-vim) then forked and improved
|
||||
by David Beniamine.
|
||||
|
||||
2.1 Todo.txt rules *TodoTxt-Rules*
|
||||
|
||||
Todo.txt is a standard human readable todo notes file defined here:
|
||||
http://todotxt.com
|
||||
|
||||
"The todo.txt format is a simple set of
|
||||
rules(https://github.com/ginatrapani/todo.txt-cli/wiki/The-Todo.txt-Format)
|
||||
that make todo.txt both human and machine-readable. The format supports
|
||||
priorities, creation and completion dates, projects and contexts. That's
|
||||
all you need to be productive. See an example Todo.txt file":
|
||||
>
|
||||
(A) Call Mom @Phone +Family
|
||||
(A) Schedule annual checkup +Health
|
||||
(B) Outline chapter 5 +FamilyNovel @Computer
|
||||
(C) Add cover sheets @ComputerOffice +FamilyTPSReports
|
||||
Plan backyard herb garden @ComputerHome
|
||||
Pick up milk @ComputerGroceryStore
|
||||
Research self-publishing services +FamilyNovel @ComputerComputer
|
||||
x Download Todo.txt mobile app @ComputerPhone
|
||||
<
|
||||
2.2 Why this fork ? *TodoTxt-Fork*
|
||||
|
||||
This plugin is a fork of freitass todo.txt-vim
|
||||
(https://github.com/freitass/todo.txt-vim). It add severals cool
|
||||
functionalities including:
|
||||
|
||||
+ Hierarchical sort: |TodoTxt-Sort| and |TodoTxt-HierarchicalSort|.
|
||||
+ A completion function: |TodoTxt-Completion|.
|
||||
+ A proper handling of due dates: |TodoTxt-Dates|
|
||||
+ A Flexible file naming: |TodoTxt-Files|.
|
||||
+ Syntax Highlight for couples key:value.
|
||||
+ `<LocalLeader>x` is a toggle which allow you to unmark a task as done.
|
||||
+ `<LocalLeader>C` Toggle Mark a task cancelled
|
||||
+ If the current buffer is a done.txt file, the basic sort sorts on
|
||||
completion date.
|
||||
+ ...
|
||||
|
||||
2.3 Installation *TodoTxt-Installation*
|
||||
|
||||
+ Vizardry
|
||||
|
||||
If you have Vizardry(https://github.com/dbeniamine/vizardry) installed,
|
||||
you can run from vim:
|
||||
>
|
||||
:Invoke -u dbeniamine todo.txt-vim
|
||||
<
|
||||
+ Pathogen install
|
||||
>
|
||||
git clone https://github.com/dbeniamine/todo.txt-vim.git ~/.vim/bundle/todo.txt-vim
|
||||
<
|
||||
Then from vim: `:Helptags` to update the doc
|
||||
|
||||
+ Quick install
|
||||
>
|
||||
git clone https://github.com/dbeniamine/todo.txt-vim.git
|
||||
cd todo.txt-vim
|
||||
cp -r ./* ~/.vim
|
||||
<
|
||||
|
||||
If you want the help installed, run `:helptags ~/.vim/doc` inside vim
|
||||
after having copied the files. Then you will be able to get the commands
|
||||
help with: `:h todo.txt`
|
||||
|
||||
===============================================================================
|
||||
3. TodoTxt Files *TodoTxt-Files* ~
|
||||
|
||||
This plugin provides a Flexible file naming for todo.txt, all the following
|
||||
names are recognized as todo:
|
||||
@@ -127,10 +126,130 @@ And obviously the same are recognize as done:
|
||||
[Dd]one.txt
|
||||
[Dd]one-[Tt]oday.txt
|
||||
<
|
||||
Moreover, remove complete tasks `<LocalLeader>D` moves the task to the
|
||||
done.txt file corresponding to the current todo.txt, aka if you are editing
|
||||
Moreover, `<LocalLeader>D` moves the task under the cursor to the done.txt
|
||||
file corresponding to the current todo.txt, aka if you are editing
|
||||
2015-07-07-todo.txt, the done file while be 2015-07-07-done.txt. If you don't
|
||||
like this behavior, you can set the default done.txt name:
|
||||
>
|
||||
let g:TodoTxtForceDoneName='done.txt'
|
||||
<
|
||||
===============================================================================
|
||||
4. Completion *TodoTxt-Completion* ~
|
||||
|
||||
This plugin provides a nice complete function for project and context, to use
|
||||
it add the following lines to your vimrc:
|
||||
>
|
||||
" Use todo#complete as the omni complete function for todo files
|
||||
au filetype todo setlocal omnifunc=todo#complete
|
||||
<
|
||||
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 <buffer> + +<C-X><C-O>
|
||||
|
||||
" Auto complete contexts
|
||||
au filetype todo imap <buffer> @ @<C-X><C-O>
|
||||
<
|
||||
|
||||
The `todo#complete` function is designed to complete projects (starting by `+`)
|
||||
and context (starting by `@`). If you use it on a regular word, it will do a
|
||||
normal keyword completion (on all buffers).
|
||||
|
||||
If you try to complete a project, it will propose all projects in all open
|
||||
buffers and for each of them, it will show their context and the name of the
|
||||
buffers in which they appears in the preview window. It does the same thing
|
||||
for context except that it gives in the preview the list of projects existing
|
||||
in each existing contexts.
|
||||
|
||||
===============================================================================
|
||||
5. Hierarchical sort *TodoTxt-HierarchicalSort* ~
|
||||
|
||||
This fork provides a hierarchical sorting function designed to do by project
|
||||
and/or by context sorts and a priority sort.
|
||||
|
||||
`<LocalLeader>sc` : Sort the file by context then by priority
|
||||
`<LocalLeader>scp` : Sort the file by context, project then by priority
|
||||
`<LocalLeader>sp` : Sort the file by project then by priority
|
||||
`<LocalLeader>spc` : Sort the file by project, context then by priority
|
||||
|
||||
The user can give argument for the two calls to vim sort function by changing
|
||||
the following variables:
|
||||
>
|
||||
g:Todo_txt_first_level_sort_mode
|
||||
g:Todo_txt_second_level_sort_mode
|
||||
<
|
||||
Defaults values are:
|
||||
|
||||
>
|
||||
g:Todo_txt_first_level_sort_mode="i"
|
||||
g:Todo_txt_second_level_sort_mode="i"
|
||||
<
|
||||
|
||||
For more information on the available flags see |:sort|
|
||||
|
||||
===============================================================================
|
||||
6. Mappings *TodoTxt-Mappings* ~
|
||||
|
||||
By default todo-txt.vim set all the mappings secribed in this section. To
|
||||
prevent this behavior, add the following line to your vimrc
|
||||
>
|
||||
let g:Todo_txt_do_not_map=1
|
||||
<
|
||||
|
||||
6.1 Sort *TodoTxt-Sort*
|
||||
|
||||
`<LocalLeader>s` : Sort the file by priority
|
||||
|
||||
`<LocalLeader>s+` : Sort the file on +Projects
|
||||
|
||||
`<LocalLeader>s@` : Sort the file on @Contexts
|
||||
|
||||
`<LocalLeader>s@` : Sort the file on due dates
|
||||
|
||||
`<LocalLeader>sc` : Sort the file by context then by priority
|
||||
|
||||
`<LocalLeader>scp` : Sort the file by context, project then by priority
|
||||
|
||||
`<LocalLeader>sp` : Sort the file by project then by priority
|
||||
|
||||
`<LocalLeader>spc` : Sort the file by project, context then by priority
|
||||
|
||||
`<leader>-sd` : Sort the file by due-date. Entries with a due date appears
|
||||
sorted by at the beginning of the file, the rest of the file is not modified.
|
||||
|
||||
6.2 Priorities *TodoTxt-Priorities*
|
||||
|
||||
`<LocalLeader>j` : Lower the priority of the current line
|
||||
|
||||
`<LocalLeader>k` : Increase the priority of the current line
|
||||
|
||||
`<LocalLeader>a` : Add the priority (A) to the current line
|
||||
|
||||
`<LocalLeader>b` : Add the priority (B) to the current line
|
||||
|
||||
`<LocalLeader>c` : Add the priority (C) to the current line
|
||||
|
||||
6.3 Dates *TodoTxt-Dates*
|
||||
|
||||
`<LocalLeader>d` : Insert the current date
|
||||
|
||||
`date<tab>` : (Insert mode) Insert the current date
|
||||
|
||||
`due:` : (Insert mode) Insert `due:` followed by the current date
|
||||
|
||||
`DUE:` : (Insert mode) Insert `DUE:` followed by the current date
|
||||
|
||||
6.4 Done *TodoTxt-Done*
|
||||
|
||||
|
||||
`<LocalLeader>x` : Toggle mark task as done (inserts or remove current
|
||||
date as completion date)
|
||||
|
||||
`<LocalLeader>C` : Toggle mark task cancelled
|
||||
|
||||
`<LocalLeader>X` : Mark all tasks as completed
|
||||
|
||||
`<LocalLeader>D` : Move completed tasks to done file, see |TodoTxt-Files|
|
||||
|
||||
`<LocalLeader>` is \ by default, so ̀`<LocaLeader>-s` means you type \s
|
||||
|
||||
@@ -19,128 +19,50 @@ setlocal wrapmargin=0
|
||||
|
||||
" Mappings {{{1
|
||||
|
||||
if !exists("g:Todo_txt_do_not_map")
|
||||
" Sort todo by (first) context
|
||||
if !hasmapto("<localleader>sc",'n')
|
||||
noremap <silent><localleader>sc :call todo#HierarchicalSort('@', '', 1)<CR>
|
||||
endif
|
||||
if !hasmapto("<localleader>scp",'n')
|
||||
noremap <silent><localleader>scp :call todo#HierarchicalSort('@', '+', 1)<CR>
|
||||
endif
|
||||
" Sort todo by (first) project
|
||||
if !hasmapto("<localleader>sp",'n')
|
||||
noremap <silent><localleader>sp :call todo#HierarchicalSort('+', '',1)<CR>
|
||||
endif
|
||||
if !hasmapto("<localleader>spc",'n')
|
||||
noremap <silent><localleader>spc :call todo#HierarchicalSort('+', '@',1)<CR>
|
||||
endif
|
||||
|
||||
noremap <silent><localleader>scp :call todo#HierarchicalSort('@', '+', 1)<CR>
|
||||
" Sort todo by (first) project
|
||||
noremap <silent><localleader>sp :call todo#HierarchicalSort('+', '',1)<CR>
|
||||
noremap <silent><localleader>spc :call todo#HierarchicalSort('+', '@',1)<CR>
|
||||
|
||||
" Sort tasks {{{2
|
||||
if !hasmapto("<localleader>s",'n')
|
||||
nnoremap <script> <silent> <buffer> <LocalLeader>s :call todo#Sort()<CR>
|
||||
endif
|
||||
|
||||
if !hasmapto("<LocalLeader>s@",'n')
|
||||
nnoremap <script> <silent> <buffer> <LocalLeader>s@ :sort /.\{-}\ze@/ <CR>
|
||||
endif
|
||||
|
||||
if !hasmapto("<LocalLeader>s+",'n')
|
||||
nnoremap <script> <silent> <buffer> <LocalLeader>s+ :sort /.\{-}\ze+/ <CR>
|
||||
endif
|
||||
" Priorities {{{2
|
||||
noremap <script> <silent> <buffer> <LocalLeader>j :call todo#PrioritizeIncrease()<CR>
|
||||
noremap <script> <silent> <buffer> <LocalLeader>k :call todo#PrioritizeDecrease()<CR>
|
||||
|
||||
if !hasmapto("<LocalLeader>j",'n')
|
||||
nnoremap <script> <silent> <buffer> <LocalLeader>j :call todo#PrioritizeIncrease()<CR>
|
||||
endif
|
||||
|
||||
if !hasmapto("<LocalLeader>j",'v')
|
||||
vnoremap <script> <silent> <buffer> <LocalLeader>j :call todo#PrioritizeIncrease()<CR>
|
||||
endif
|
||||
|
||||
if !hasmapto("<LocalLeader>k",'n')
|
||||
nnoremap <script> <silent> <buffer> <LocalLeader>k :call todo#PrioritizeDecrease()<CR>
|
||||
endif
|
||||
|
||||
if !hasmapto("<LocalLeader>k",'v')
|
||||
vnoremap <script> <silent> <buffer> <LocalLeader>k :call todo#PrioritizeDecrease()<CR>
|
||||
endif
|
||||
|
||||
if !hasmapto("<LocalLeader>a",'n')
|
||||
nnoremap <script> <silent> <buffer> <LocalLeader>a :call todo#PrioritizeAdd('A')<CR>
|
||||
endif
|
||||
|
||||
if !hasmapto("<LocalLeader>a",'i')
|
||||
inoremap <script> <silent> <buffer> <LocalLeader>a <ESC>:call todo#PrioritizeAdd('A')<CR>i
|
||||
endif
|
||||
|
||||
if !hasmapto("<LocalLeader>a",'v')
|
||||
vnoremap <script> <silent> <buffer> <LocalLeader>a :call todo#PrioritizeAdd('A')<CR>
|
||||
endif
|
||||
|
||||
if !hasmapto("<LocalLeader>b",'n')
|
||||
nnoremap <script> <silent> <buffer> <LocalLeader>b :call todo#PrioritizeAdd('B')<CR>
|
||||
endif
|
||||
|
||||
if !hasmapto("<LocalLeader>b",'i')
|
||||
inoremap <script> <silent> <buffer> <LocalLeader>b <ESC>:call todo#PrioritizeAdd('B')<CR>i
|
||||
endif
|
||||
|
||||
if !hasmapto("<LocalLeader>b",'v')
|
||||
vnoremap <script> <silent> <buffer> <LocalLeader>b :call todo#PrioritizeAdd('B')<CR>
|
||||
endif
|
||||
|
||||
if !hasmapto("<LocalLeader>c",'n')
|
||||
nnoremap <script> <silent> <buffer> <LocalLeader>c :call todo#PrioritizeAdd('C')<CR>
|
||||
endif
|
||||
if !hasmapto("<LocalLeader>c",'i')
|
||||
inoremap <script> <silent> <buffer> <LocalLeader>c <ESC>:call todo#PrioritizeAdd('C')<CR>i
|
||||
endif
|
||||
|
||||
if !hasmapto("<LocalLeader>c",'v')
|
||||
vnoremap <script> <silent> <buffer> <LocalLeader>c :call todo#PrioritizeAdd('C')<CR>
|
||||
endif
|
||||
noremap <script> <silent> <buffer> <LocalLeader>a :call todo#PrioritizeAdd('A')<CR>
|
||||
noremap <script> <silent> <buffer> <LocalLeader>b :call todo#PrioritizeAdd('B')<CR>
|
||||
noremap <script> <silent> <buffer> <LocalLeader>c :call todo#PrioritizeAdd('C')<CR>
|
||||
|
||||
" Insert date {{{2
|
||||
if !hasmapto("date<Tab>",'i')
|
||||
inoremap <script> <silent> <buffer> date<Tab> <C-R>=strftime("%Y-%m-%d")<CR>
|
||||
endif
|
||||
|
||||
if !hasmapto("due:",'i')
|
||||
inoremap <script> <silent> <buffer> due: due:<C-R>=strftime("%Y-%m-%d")<CR>
|
||||
endif
|
||||
|
||||
if !hasmapto("DUE:",'i')
|
||||
inoremap <script> <silent> <buffer> DUE: DUE:<C-R>=strftime("%Y-%m-%d")<CR>
|
||||
endif
|
||||
|
||||
if !hasmapto("<localleader>d",'n')
|
||||
nnoremap <script> <silent> <buffer> <localleader>d :call todo#PrependDate()<CR>
|
||||
endif
|
||||
|
||||
if !hasmapto("<localleader>d",'v')
|
||||
vnoremap <script> <silent> <buffer> <localleader>d :call todo#PrependDate()<CR>
|
||||
endif
|
||||
noremap <script> <silent> <buffer> <localleader>d :call todo#PrependDate()<CR>
|
||||
|
||||
" Mark done {{{2
|
||||
if !hasmapto("<localleader>x",'n')
|
||||
nnoremap <script> <silent> <buffer> <localleader>x :call todo#ToggleMarkAsDone()<CR>
|
||||
endif
|
||||
noremap <script> <silent> <buffer> <localleader>x :call todo#ToggleMarkAsDone('')<CR>
|
||||
|
||||
" Mark done {{{2
|
||||
noremap <script> <silent> <buffer> <localleader>C :call todo#ToggleMarkAsDone('Cancelled')<CR>
|
||||
|
||||
|
||||
if !hasmapto("<localleader>x",'v')
|
||||
vnoremap <script> <silent> <buffer> <localleader>x :call todo#ToggleMarkAsDone()<CR>
|
||||
endif
|
||||
|
||||
" Mark all done {{{2
|
||||
if !hasmapto("<localleader>X",'n')
|
||||
nnoremap <script> <silent> <buffer> <localleader>X :call todo#MarkAllAsDone()<CR>
|
||||
endif
|
||||
noremap <script> <silent> <buffer> <localleader>X :call todo#MarkAllAsDone()<CR>
|
||||
|
||||
" Remove completed {{{2
|
||||
if !hasmapto("<localleader>D",'n')
|
||||
nnoremap <script> <silent> <buffer> <localleader>D :call todo#RemoveCompleted()<CR>
|
||||
endif
|
||||
|
||||
" Sort by due: date {{{2
|
||||
if !hasmapto("<localleader>sd".'n')
|
||||
nnoremap <script> <silent> <buffer> <localleader>sd :call todo#SortDue()<CR>
|
||||
endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user