Compare commits
186 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0035f0ddb7 | ||
|
|
61960a9ae3 | ||
|
|
16373b82df | ||
|
|
9bff4b6bf1 | ||
|
|
ae75dd6e62 | ||
|
|
37d46d4cf8 | ||
|
|
722fc9ac19 | ||
|
|
c3def81fba | ||
|
|
ff4334906a | ||
|
|
5585652ca6 | ||
|
|
11811d90a7 | ||
|
|
550c956cdd | ||
|
|
36fd3b427d | ||
|
|
2bedaf4672 | ||
|
|
84b5ae6413 | ||
|
|
c07439984e | ||
|
|
95636b0026 | ||
|
|
59aeb3f44a | ||
|
|
e8231d5632 | ||
|
|
89bd394f43 | ||
|
|
4205e1c690 | ||
|
|
ba4854e365 | ||
|
|
109c2d298f | ||
|
|
9db15c6697 | ||
|
|
c84773fe8c | ||
|
|
b9dc37a61a | ||
|
|
1caddf5890 | ||
|
|
08619942d9 | ||
|
|
1a4d977cac | ||
|
|
fe5cfbc506 | ||
|
|
20e137bfcf | ||
|
|
3f560df79b | ||
|
|
f1788f53f9 | ||
|
|
41889361b0 | ||
|
|
d51562a4c1 | ||
|
|
c8fbe04351 | ||
|
|
72beefa27a | ||
|
|
9d1443b663 | ||
|
|
80003c2b07 | ||
|
|
00ecbeb8b7 | ||
|
|
739d58ec8c | ||
|
|
74ea6248dd | ||
|
|
cfc6000948 | ||
|
|
8554880297 | ||
|
|
224986ab96 | ||
|
|
afa1b0bc01 | ||
|
|
a2090399fb | ||
|
|
81d9edfb0d | ||
|
|
93480dd2c7 | ||
|
|
10e796891c | ||
|
|
070e68721b | ||
|
|
259125d9ef | ||
|
|
2483961aaf | ||
|
|
7b0262ae84 | ||
|
|
f23b1c2cac | ||
|
|
aa5a702057 | ||
|
|
7d70e30aae | ||
|
|
d6256bcfe3 | ||
|
|
f982b9c581 | ||
|
|
5f2497d3fa | ||
|
|
ea7eb42d62 | ||
|
|
678c3b8680 | ||
|
|
0744fdf45b | ||
|
|
7160425fa8 | ||
|
|
8cb1a76eed | ||
|
|
87f94ef7bd | ||
|
|
25fa5dcf15 | ||
|
|
f35bcabcea | ||
|
|
21908548d4 | ||
|
|
6777558646 | ||
|
|
ebdde99ac4 | ||
|
|
c6e472c048 | ||
|
|
c8092640df | ||
|
|
c2ad4bc58b | ||
|
|
68e407af22 | ||
|
|
22fb99260e | ||
|
|
f39504bea8 | ||
|
|
08d3ed88d9 | ||
|
|
4119ff026f | ||
|
|
ff533b85f5 | ||
|
|
774d4da4e9 | ||
|
|
0ed7d4848e | ||
|
|
7bebc01020 | ||
|
|
f5050663c6 | ||
|
|
b8fa774606 | ||
|
|
35810c388d | ||
|
|
311761e327 | ||
|
|
71505569c0 | ||
|
|
6d1d2d035a | ||
|
|
491c3c7fba | ||
|
|
70b05c2c76 | ||
|
|
30f112a8ac | ||
|
|
a778ef5590 | ||
|
|
03fe8bb167 | ||
|
|
aa618973e2 | ||
|
|
7b9c9815a4 | ||
|
|
57d45200c8 | ||
|
|
484c12771e | ||
|
|
f77215ca80 | ||
|
|
849a7d5f61 | ||
|
|
0e2b110903 | ||
|
|
aad48b0231 | ||
|
|
81e64682d0 | ||
|
|
303ab65237 | ||
|
|
c2eb67f1a6 | ||
|
|
85c215b4cc | ||
|
|
3e3251f8b5 | ||
|
|
0863e1434e | ||
|
|
ca8ae307d3 | ||
|
|
95d97151c5 | ||
|
|
1cdb39032f | ||
|
|
f3c5e7b892 | ||
|
|
1e3a5e58ae | ||
|
|
89570cbaef | ||
|
|
a21fd1198c | ||
|
|
7515fde8ae | ||
|
|
4548961329 | ||
|
|
8dd24d0b68 | ||
|
|
e2a02d4f30 | ||
|
|
595fc0b49e | ||
|
|
a612ebeaf1 | ||
|
|
17a2345675 | ||
|
|
e13eb4bb9c | ||
|
|
d769f12710 | ||
|
|
2535cf2ece | ||
|
|
eb7f7cb8f4 | ||
|
|
87a6c371dd | ||
|
|
29a6ea4b1d | ||
|
|
03501dfe42 | ||
|
|
fc0b4c3272 | ||
|
|
b87c7dd98d | ||
|
|
7232106f45 | ||
|
|
6e1bcc0e1a | ||
|
|
03f5575363 | ||
|
|
2e2d39daee | ||
|
|
a03d01e58e | ||
|
|
81c2772905 | ||
|
|
b6d5dc6bb9 | ||
|
|
f9a007ac58 | ||
|
|
45bfb325ae | ||
|
|
081d9d2e3a | ||
|
|
4d819f888b | ||
|
|
b3d9e18b08 | ||
|
|
a98711da91 | ||
|
|
0a917143c5 | ||
|
|
41a75a8f50 | ||
|
|
cc281c47eb | ||
|
|
f3a3bdbefb | ||
|
|
3089527c71 | ||
|
|
7fdf0427a8 | ||
|
|
644b6d6628 | ||
|
|
d3b011b718 | ||
|
|
c13a277e2a | ||
|
|
421916b25d | ||
|
|
8da977113b | ||
|
|
2a04312e8d | ||
|
|
85b2e86b73 | ||
|
|
1e465dd931 | ||
|
|
79e4d352a2 | ||
|
|
ddbcdd823f | ||
|
|
77cfafb9f0 | ||
|
|
fbc45c5c8c | ||
|
|
6c5a37e6c6 | ||
|
|
25a63d5ecd | ||
|
|
04210abd70 | ||
|
|
649f962211 | ||
|
|
b1ed8608d1 | ||
|
|
f30ac979a1 | ||
|
|
40faa56012 | ||
|
|
51c821b5da | ||
|
|
6c073cdb42 | ||
|
|
e508140f90 | ||
|
|
d0080e66f9 | ||
|
|
e071156b8d | ||
|
|
1f8b706d8e | ||
|
|
0e3c5cb2b6 | ||
|
|
32188000f9 | ||
|
|
1cc11c56ad | ||
|
|
639fcd85a2 | ||
|
|
b8a5bd64ca | ||
|
|
95ed508741 | ||
|
|
05b5be07d2 | ||
|
|
08fcb4ccdb | ||
|
|
e817f5eca8 | ||
|
|
2d83ed8dc2 | ||
|
|
52e1527e9b |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,2 +1,3 @@
|
||||
*.swp
|
||||
doc/tags
|
||||
*.pyc
|
||||
|
||||
17
.gitlab-ci.yml
Normal file
17
.gitlab-ci.yml
Normal file
@@ -0,0 +1,17 @@
|
||||
test-vim-latest:
|
||||
image: thinca/vim:v7.4
|
||||
script:
|
||||
- cd tests
|
||||
- bash runtests.sh
|
||||
|
||||
test-vim-7.4:
|
||||
image: thinca/vim:v7.4
|
||||
script:
|
||||
- cd tests
|
||||
- bash runtests.sh
|
||||
|
||||
test-neovim:
|
||||
image: lambdalisue/neovim-ci
|
||||
script:
|
||||
- cd tests
|
||||
- bash runtests.sh
|
||||
674
LICENSE
Normal file
674
LICENSE
Normal file
@@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
todo.txt-vim
|
||||
Copyright (C) 2019 David Beniamine
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
todo.txt-vim Copyright (C) 2019 David Beniamine
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
400
README.markdown
400
README.markdown
@@ -1,93 +1,167 @@
|
||||
# Readme
|
||||
**This repository is only a mirror, all developpment happens at [gitlab](https://gitlab.com/dbeniamine/todo.txt-vim)**
|
||||
|
||||
**Note:** Since v0.7.3, `TodoComplete` is `todo#Complete`, you might need to
|
||||
update your vimrc.
|
||||
# Todo.txt-vim
|
||||
|
||||
## 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. [Recurrence](#recurrence)
|
||||
7. [Mappings](#mappings)
|
||||
1. [Sort](#sort)
|
||||
2. [Priorities](#priorities)
|
||||
3. [Dates](#dates)
|
||||
4. [Done](#done)
|
||||
|
||||
## Release notes
|
||||
|
||||
+ V0.8.1 Incorporates yet another Fretep work : highlighting for tasks due today.
|
||||
|
||||
+ v0.8 Incorporates Fretep's work on overdue dates (PR#13 and PR#16) which
|
||||
removes python dependency, allow to control the cursor position after a sort by
|
||||
todo (see (sort)[#sort] and/or issue #15) and fixes bug when sorting a file
|
||||
containing only lines with due:date (issue #14).
|
||||
|
||||
+ v0.7.6 Incorporates [Sietse's work](https://github.com/sietse/todo.txt-vim/commit/57d45200c8b033d31c9191ee0eb0711c801cdb1d) to make cancel and mark as done mapping repeatable using [vim-repeat](https://github.com/tpope/vim-repeat).
|
||||
+ v0.7.5 Incorporates [Fievel's work](https://github.com/fievel/todo.txt-vim/commit/0863e1434e9a89ace06c4856b6cb32ba9906e3de) to make overduedates work on python3.
|
||||
+ v0.7.4 includes the overduedate support from Guilherme Victal (see pull
|
||||
|
||||
[request #45 on freitass version](https://github.com/freitass/todo.txt-vim/pull/45)),
|
||||
it highlight dates in overdue tasks as an Error. It depends on a
|
||||
Python library, however, and as such will only be able to work if your version
|
||||
of Vim was compiled with the `+python` option (as most common versions do).
|
||||
|
||||
If your Vim installation does **not** have Python support, this plugin **will work just fine** but this feature will be disabled.
|
||||
|
||||
|
||||
+ 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/todotxt/todotxt/)
|
||||
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 several 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
|
||||
Todo.txt-vim is a filetype plugin, make sure that your vimrc contains :
|
||||
|
||||
git clone https://github.com/dbeniamine/todo.txt-vim.git
|
||||
cd todo.txt-vim
|
||||
cp -r ./* ~/.vim
|
||||
```vim
|
||||
syntax on
|
||||
filetype plugin on
|
||||
```
|
||||
|
||||
#### 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`
|
||||
|
||||
### Pathogen install
|
||||
## TodoTxt Files
|
||||
|
||||
git clone https://github.com/dbeniamine/todo.txt-vim.git ~/.vim/bundle/todo.txt-vim
|
||||
This plugin provides flexible file naming for todo.txt, all the following
|
||||
names are recognized as todo:
|
||||
|
||||
Then from vim: `:Helptags` to update the doc
|
||||
YYYY-MM-[Tt]odo.txt
|
||||
YYYY-MM-DD[Tt]odo.txt
|
||||
[Tt]odo-YYYY-MM.txt
|
||||
[Tt]odo-YYYY-MM-DD.txt
|
||||
[Tt]odo.txt
|
||||
[Tt]oday.txt
|
||||
|
||||
## Features included in Freitass version
|
||||
And obviously the same are recognize as done:
|
||||
|
||||
This plugin gives syntax highlighting to [todo.txt](http://todotxt.com/) files. It also defines a few mappings, to help with editing these files:
|
||||
YYYY-MM-[Dd]one.txt
|
||||
YYYY-MM-DD[Dd]one.txt
|
||||
[Dd]one-YYYY-MM.txt
|
||||
[Dd]one-YYYY-MM-DD.txt
|
||||
[Dd]one.txt
|
||||
[Dd]one-[Tt]oday.txt
|
||||
|
||||
`<LocalLeader>s` : Sort the file
|
||||
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 will be 2015-07-07-done.txt. If you don't
|
||||
like this behavior, you can set the default done.txt name:
|
||||
|
||||
`<LocalLeader>s+` : Sort the file on +Projects
|
||||
let g:TodoTxtForceDoneName='done.txt'
|
||||
|
||||
`<LocalLeader>s@` : Sort the file on @Contexts
|
||||
## Completion
|
||||
|
||||
`<LocalLeader>j` : Lower the priority of the current line
|
||||
This plugin provides a nice complete function for project and context, to use
|
||||
it add the following lines to your vimrc:
|
||||
|
||||
`<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
|
||||
" 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:
|
||||
@@ -98,66 +172,172 @@ adding the next lines to your vimrc:
|
||||
" 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
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
### Due dates
|
||||
If you don't want the preview window to open when performing completion, add the
|
||||
following lines to your vimrc:
|
||||
|
||||
I've integrated the [work from
|
||||
durcheinandr](https://github.com/durcheinandr/todo.txt-vim/) concerning due
|
||||
dates + some little improvements:
|
||||
au filetype todo setlocal completeopt-=preview
|
||||
|
||||
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:
|
||||
If you would like the preview window to open even if there is only one match for
|
||||
a completion, then add the following lines to your vimrc:
|
||||
|
||||
`<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.
|
||||
au filetype todo setlocal completeopt+=menuone
|
||||
|
||||
`due:` : (Insert mode) Insert `due:` followed by the current date
|
||||
|
||||
`DUE:` : (Insert mode) Insert `DUE:` followed by the current date
|
||||
## Hierarchical sort
|
||||
|
||||
### Flexible File naming
|
||||
This fork provides a hierarchical sorting function designed to do by project
|
||||
and/or by context sorts and a priority sort.
|
||||
|
||||
This plugin provides a Flexible file naming for todo.txt, all the following
|
||||
names are recognized as todo:
|
||||
`<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
|
||||
|
||||
YYYY-MM-[Tt]odo.txt
|
||||
YYYY-MM-DD[Tt]odo.txt
|
||||
[Tt]odo-YYYY-MM.txt
|
||||
[Tt]odo-YYYY-MM-DD.txt
|
||||
[Tt]odo.txt
|
||||
[Tt]oday.txt
|
||||
The user can give argument for the two calls to vim sort function by changing
|
||||
the following variables:
|
||||
|
||||
And obviously the same are recognize as done:
|
||||
g:Todo_txt_first_level_sort_mode
|
||||
g:Todo_txt_second_level_sort_mode
|
||||
|
||||
YYYY-MM-[Dd]one.txt
|
||||
YYYY-MM-DD[Dd]one.txt
|
||||
[Dd]one-YYYY-MM.txt
|
||||
[Dd]one-YYYY-MM-DD.txt
|
||||
[Dd]one.txt
|
||||
[Dd]one-[Tt]oday.txt
|
||||
Defaults values are:
|
||||
|
||||
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
|
||||
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'
|
||||
g:Todo_txt_first_level_sort_mode="i"
|
||||
g:Todo_txt_second_level_sort_mode="i"
|
||||
|
||||
### Others
|
||||
|
||||
`<LocalLeader>x` is a toggle which allow you to unmark a task as done.
|
||||
For more information on the available flags see `help :sort`
|
||||
|
||||
Syntax highlighting for couples key:value
|
||||
## Recurrence
|
||||
|
||||
If the current buffer is a done.txt file, the basic sort sorts on completion
|
||||
date.
|
||||
By adding a `rec:` tag to your task, when you complete (`<LocalLeader>x`) or
|
||||
postpone (`<LocalLeader>p`) the task, a new recurrence will be created due after
|
||||
the specified amount of time.
|
||||
|
||||
The format is:
|
||||
`rec:[+][count][d|w|m|y]`
|
||||
|
||||
Where:
|
||||
d = days, w = weeks, m = months, y = years
|
||||
The optional `+` specifies strict recurrence (see below)
|
||||
|
||||
Examples:
|
||||
* `rec:2w` - Recurs two weeks after the task is completed.
|
||||
* `rec:3d` - Recurs three days after the task is completed.
|
||||
* `rec:+1w` - Recurs one week from the due date (strict)
|
||||
|
||||
This is a non-standard but widely adopted keyword.
|
||||
|
||||
## Mappings
|
||||
|
||||
By default todo-txt.vim sets all the mappings described 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>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
|
||||
+ `<LocalLeader>sd` : Sort the file on due dates. Entries with a due date appear
|
||||
sorted by at the beginning of the file, completed tasks are moved to the bottom and
|
||||
the rest of the file is not modified.
|
||||
|
||||
When you sort by due dates, at the end of the sort, your cursor will be placed
|
||||
at the top of the file. This behavior can be set with the following global
|
||||
variable :
|
||||
|
||||
let g:TodoTxtSortDueDateCursorPos = "top"
|
||||
|
||||
Possible values are :
|
||||
|
||||
+ `top` (default): The first line of the buffer, i.e. your most outstanding task
|
||||
+ `lastdue`: The last task with a due:date set
|
||||
+ `notoverdue`: The first task that is not overdue (requires #13)
|
||||
+ `bottom`: The last line of the buffer
|
||||
|
||||
### 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
|
||||
+ `<LocalLeader>p` : Postpone the due date (accepts a count)
|
||||
+ `<LocalLeader>P` : Decrement the due date (accepts a count)
|
||||
+ `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
|
||||
|
||||
If you would like the creation date (today) prefixed on new lines, add the
|
||||
following to your vimrc:
|
||||
|
||||
let g:Todo_txt_prefix_creation_date=1
|
||||
|
||||
With insert mode maps on, typing `date<Tab>` or `due:` can feel like glitches
|
||||
This is because vim wait for mappings before inserting the words to the buffer.
|
||||
To prevent the glitches, abbreviations can be used instead of mappings.
|
||||
To turn it on, add the following to your vimrc:
|
||||
|
||||
let g:TodoTxtUseAbbrevInsertMode=1
|
||||
|
||||
Abbreviations uses word separator to expand the abbreviations, thus `<Tab>`
|
||||
is unavailable on abbreviations. Turning abbreviations mode will change
|
||||
`date<Tab>` mapping into `date:`. The resulting abbreviations would be:
|
||||
|
||||
+ `date:` : (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)
|
||||
|
||||
When you mark an item with a priority as done, it is assigned a priority tag
|
||||
like `pri:A` so that the priority can be restored if the item is toggled back
|
||||
to undone. If you don't want the tags showing up in your done file, you can
|
||||
disable this behavior by setting the following global variable:
|
||||
|
||||
let g:TodoTxtStripDoneItemPriority=1
|
||||
|
||||
### Format
|
||||
|
||||
+ `<LocalLeader>ff` : Try to fix todo.txt format
|
||||
|
||||
## Fold
|
||||
|
||||
Todo.txt files can be folded by projects or context (see `:help fold`), by
|
||||
default they are foldable by context, to use project fold :
|
||||
|
||||
let g:Todo_fold_char='+'
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
" File: autoload/todo.vim
|
||||
" Description: Todo.txt sorting plugin
|
||||
" Author: David Beniamine <david@beniamine.net>
|
||||
" Author: David Beniamine <david@beniamine.net>, Peter (fretep) <githib.5678@9ox.net>
|
||||
" Licence: Vim licence
|
||||
" Website: http://github.com/dbeniamine/todo.txt.vim
|
||||
" Version: 0.7.3
|
||||
" vim: ts=4 sw=4 :help tw=78 cc=80
|
||||
|
||||
" These two variables are parameters for the successive calls the vim sort
|
||||
" '' means no flags
|
||||
@@ -23,8 +21,13 @@ endif
|
||||
|
||||
" Functions {{{1
|
||||
|
||||
" Increment and Decrement The Priority
|
||||
:set nf=octal,hex,alpha
|
||||
|
||||
function! todo#GetCurpos()
|
||||
if exists("*getcurpos")
|
||||
return getcurpos()
|
||||
endif
|
||||
return getpos('.')
|
||||
endfunction
|
||||
|
||||
function! todo#PrioritizeIncrease()
|
||||
normal! 0f)h
|
||||
@@ -35,19 +38,20 @@ function! todo#PrioritizeDecrease()
|
||||
endfunction
|
||||
|
||||
function! todo#PrioritizeAdd (priority)
|
||||
let oldpos=getcurpos()
|
||||
let oldpos=todo#GetCurpos()
|
||||
let line=getline('.')
|
||||
if line !~ '^([A-F])'
|
||||
if line !~ '^([A-W])'
|
||||
:call todo#PrioritizeAddAction(a:priority)
|
||||
let oldpos[2]+=4
|
||||
else
|
||||
exec ':s/^([A-F])/('.a:priority.')/'
|
||||
exec ':s/^([A-W])/('.a:priority.')/'
|
||||
endif
|
||||
call setpos('.',oldpos)
|
||||
endfunction
|
||||
|
||||
function! todo#PrioritizeAddAction (priority)
|
||||
execute "normal! mq0i(".a:priority.") \<esc>`q"
|
||||
execute "delmarks q"
|
||||
endfunction
|
||||
|
||||
function! todo#RemovePriority()
|
||||
@@ -55,28 +59,68 @@ function! todo#RemovePriority()
|
||||
endfunction
|
||||
|
||||
function! todo#PrependDate()
|
||||
normal! 0"=strftime("%Y-%m-%d ")
|
||||
P
|
||||
endfunction
|
||||
|
||||
function! todo#ToggleMarkAsDone()
|
||||
if (getline(".") =~ 'x\s*\d\{4\}')
|
||||
if (getline(".") =~ '\v^\(')
|
||||
execute "normal! 0f)a\<space>\<esc>l\"=strftime(\"%Y-%m-%d\")\<esc>P"
|
||||
else
|
||||
else
|
||||
normal! I=strftime("%Y-%m-%d ")
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
||||
function! todo#UnMarkAsDone()
|
||||
function todo#SaveRegisters()
|
||||
let s:last_search=@/
|
||||
endfunction
|
||||
|
||||
|
||||
function todo#RestoreRegisters()
|
||||
let @/=s:last_search
|
||||
endfunction
|
||||
|
||||
function! todo#ToggleMarkAsDone(status)
|
||||
call todo#SaveRegisters()
|
||||
if (getline(".") =~ '\C^x\s*\d\{4\}')
|
||||
:call todo#UnMarkAsDone(a:status)
|
||||
else
|
||||
:call todo#MarkAsDone(a:status)
|
||||
endif
|
||||
call todo#RestoreRegisters()
|
||||
endfunction
|
||||
|
||||
function! todo#FixFormat()
|
||||
" Remove heading space
|
||||
silent! %s/\C^\s*//
|
||||
" Remove priority from done tasks
|
||||
silent! %s/\C^x (\([A-Z]\)) \(.*\)/x \2 pri:\1/
|
||||
endfunction
|
||||
|
||||
function! todo#UnMarkAsDone(status)
|
||||
if a:status==''
|
||||
let pat=''
|
||||
else
|
||||
let pat=' '.a:status
|
||||
endif
|
||||
exec ':s/\C^x\s*\d\{4}-\d\{1,2}-\d\{1,2}'.pat.'\s*//g'
|
||||
silent s/\C\(.*\) pri:\([A-Z]\)/(\2) \1/e
|
||||
endfunction
|
||||
|
||||
function! todo#MarkAsDone(status)
|
||||
call todo#CreateNewRecurrence(1)
|
||||
if get(g:, 'TodoTxtStripDoneItemPriority', 0)
|
||||
exec ':s/\C^(\([A-Z]\))\(.*\)/\2/e'
|
||||
else
|
||||
exec ':s/\C^(\([A-Z]\))\(.*\)/\2 pri:\1/e'
|
||||
endif
|
||||
if a:status!=''
|
||||
exec 'normal! I'.a:status.' '
|
||||
endif
|
||||
call todo#PrependDate()
|
||||
call todo#PrependDate()
|
||||
if (getline(".") =~ '^ ')
|
||||
normal! gIx
|
||||
else
|
||||
normal! Ix
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! todo#MarkAllAsDone()
|
||||
function! todo#MarkAllAsDone()
|
||||
:g!/^x /:call todo#MarkAsDone('')
|
||||
endfunction
|
||||
|
||||
function! s:AppendToFile(file, lines)
|
||||
@@ -100,7 +144,13 @@ function! todo#RemoveCompleted()
|
||||
if exists("g:TodoTxtForceDoneName")
|
||||
let l:done=g:TodoTxtForceDoneName
|
||||
else
|
||||
else
|
||||
let l:currentfile=expand('%:t')
|
||||
|
||||
if l:currentfile =~ '[Tt]oday.txt'
|
||||
let l:done=substitute(substitute(l:currentfile,'today','done-today',''),'Today','Done-Today','')
|
||||
else
|
||||
let l:done=substitute(substitute(l:currentfile,'todo','done',''),'Todo','Done','')
|
||||
endif
|
||||
endif
|
||||
let l:done_file = l:target_dir.'/'.l:done
|
||||
echo "Writing to ".l:done_file
|
||||
@@ -114,37 +164,119 @@ function! todo#RemoveCompleted()
|
||||
call s:AppendToFile(l:done_file, l:completed)
|
||||
endfunction
|
||||
|
||||
|
||||
function! todo#Sort(type)
|
||||
" vim :sort is usually stable
|
||||
" we sort first on contexts, then on projects and then on priority
|
||||
" we sort first on contexts, then on projects and then on priority
|
||||
let g:Todo_fold_char='x'
|
||||
let oldcursor=todo#GetCurpos()
|
||||
if(a:type != "")
|
||||
exec ':sort /.\{-}\ze'.a:type.'/'
|
||||
elseif expand('%')=~'[Dd]one.*.txt'
|
||||
" FIXME: Put some unit tests around this, and fix case sensitivity if ignorecase is set.
|
||||
silent! %s/\(x\s*\d\{4}\)-\(\d\{2}\)-\(\d\{2}\)/\1\2\3/g
|
||||
sort n /^x\s*/
|
||||
silent! %s/\(x\s*\d\{4}\)\(\d\{2}\)/\1-\2-/g
|
||||
else
|
||||
else
|
||||
sort /@[a-zA-Z]*/ r
|
||||
sort /+[a-zA-Z]*/ r
|
||||
silent normal gg
|
||||
let l:first=search('^\s*x')
|
||||
if l:first != 0
|
||||
sort /^./r
|
||||
" at this point done tasks are at the end
|
||||
let l:first=search('^\s*x')
|
||||
let l:last=search('^\s*x','b')
|
||||
let l:diff=l:last-l:first+1
|
||||
" Cut the done lines
|
||||
silent execute ':'.l:first.'d a '.l:diff
|
||||
endif
|
||||
silent sort /@[a-zA-Z]*/ r
|
||||
silent sort /+[a-zA-Z]*/ r
|
||||
silent sort /\v\([A-Z]\)/ r
|
||||
"Now tasks without priority are at beggining, move them to the end
|
||||
silent normal gg
|
||||
let l:firstP=search('^\s*([A-Z])', 'cn')
|
||||
if l:firstP > 1
|
||||
let num=l:firstP-1
|
||||
" Sort normal
|
||||
silent execute ':1 d b'.num
|
||||
silent normal G"bp
|
||||
endif
|
||||
if l:first != 0
|
||||
silent normal G"ap
|
||||
silent execute ':'.l:first.','.l:last.'sort /@[a-zA-Z]*/ r'
|
||||
silent execute ':'.l:first.','.l:last.'sort /+[a-zA-Z]*/ r'
|
||||
silent execute ':'.l:first.','.l:last.'sort /\v([A-Z])/ r'
|
||||
endif
|
||||
endif
|
||||
call setpos('.', oldcursor)
|
||||
endfunction
|
||||
|
||||
function! todo#SortDue()
|
||||
function! todo#SortDue()
|
||||
silent! %s/\([dD][uU][eE]:\d\{4}\)-\(\d\{2}\)-\(\d\{2}\)/\1\2\3/g
|
||||
" Sort adding entries with due dates add the beginning
|
||||
sort n /[dD][uU][eE]:/
|
||||
" Count the number of lines
|
||||
silent normal gg
|
||||
execute "/[dD][uU][eE]:"
|
||||
let l:first=getpos(".")[1]
|
||||
silent normal N
|
||||
let l:last=getpos(".")[1]
|
||||
" Check how many lines have a due:date on them
|
||||
let l:tasksWithDueDate = 0
|
||||
silent! %global/\v\c<due:\d{4}-\d{2}-\d{2}>/let l:tasksWithDueDate += 1
|
||||
if l:tasksWithDueDate == 0
|
||||
" No tasks with a due:date: No need to modify the buffer at all
|
||||
" Also means we don't need to cater for no matches on searches below
|
||||
return
|
||||
endif
|
||||
" FIXME: There is a small chance that due:\d{8} might legitimately exist in the buffer
|
||||
" We modify due:yyyy-mm-dd to yyyymmdd which would then mean we would alter the buffer
|
||||
" in an unexpected way, altering user data. Not sure how to deal with this at the moment.
|
||||
" I'm going to throw an exception, and if this is a problem we can revisit.
|
||||
silent %global/\v\c<due:\d{8}>/throw "Text matching 'due:\\d\\{8\\}' exists in the buffer, this function cannot sort your buffer"
|
||||
" Turn the due:date from due:yyyy-mm-dd to due:yyyymmdd so we can do a numeric sort
|
||||
silent! %substitute/\v<(due:\d{4})\-(\d{2})\-(\d{2})>/\1\2\3/ei
|
||||
" Sort all the lines with due: by numeric yyyymmdd, they will end up in ascending order at the bottom of the buffer
|
||||
sort in /\v\c<due:\ze\d{8}>/
|
||||
" Determine the line number of the first task with a due:date
|
||||
let l:firstLineWithDue = line("$") - l:tasksWithDueDate + 1
|
||||
" Put the sorted lines at the beginning of the file
|
||||
" Put the sorted lines at the beginning of the file
|
||||
execute ':'.l:first
|
||||
execute ':d'.l:diff
|
||||
silent normal gg
|
||||
silent normal P
|
||||
if l:firstLineWithDue > 1
|
||||
" ...but only if the whole file didn't get sorted.
|
||||
execute "silent " . l:firstLineWithDue . ",$move 0"
|
||||
endif
|
||||
" Change the due:yyyymmdd back to due:yyyy-mm-dd.
|
||||
silent! %substitute/\v<(due:\d{4})(\d{2})(\d{2})>/\1-\2-\3/ei
|
||||
silent global/\C^x /move$
|
||||
" Let's check a global for a user preference on the cursor position.
|
||||
if exists("g:TodoTxtSortDueDateCursorPos")
|
||||
if g:TodoTxtSortDueDateCursorPos ==? "top"
|
||||
normal gg
|
||||
elseif g:TodoTxtSortDueDateCursorPos ==? "lastdue" || g:TodoTxtSortDueDateCursorPos ==? "notoverdue"
|
||||
silent normal G
|
||||
" Sorry for the crazy RegExp. The next command should put cursor at at the top of the completed tasks,
|
||||
" or the bottom of the buffer. This is done by searching backwards for any line not starting with
|
||||
" "x " (x, space) which is important to distinguish from "xample task" for instance, which the more
|
||||
" simple "^[^x]" would match. More info: ":help /\@!". Be sure to enforce case sensitivity on "x".
|
||||
:silent! ?\v\C^(x )@!?+1
|
||||
let l:overduePat = todo#GetDateRegexForPastDates()
|
||||
let l:lastwrapscan = &wrapscan
|
||||
set nowrapscan
|
||||
try
|
||||
if g:TodoTxtSortDueDateCursorPos ==? "lastdue"
|
||||
" This searches backwards for the last due task
|
||||
:?\v\c<due:\d{4}\-\d{2}\-\d{2}>
|
||||
" Try a forward search in case the last line of the buffer was a due:date task, don't match done
|
||||
" Be sure to enforce case sensitivity on "x" while allowing mixed case on "due:"
|
||||
:silent! /\v\C^(x )@!&.*<[dD][uU][eE]:\d{4}\-\d{2}\-\d{2}>
|
||||
elseif g:TodoTxtSortDueDateCursorPos ==? "notoverdue"
|
||||
" This searches backwards for the last overdue task, and positions the cursor on the following line
|
||||
execute ":?\\v\\c<due:" . l:overduePat . ">?+1"
|
||||
endif
|
||||
catch
|
||||
" Might fail if there are no active (or overdue) due:date tasks. Requires nowrapscan
|
||||
" This code path always means we want to be at the top of the buffer
|
||||
normal gg
|
||||
finally
|
||||
let &wrapscan = l:lastwrapscan
|
||||
endtry
|
||||
elseif g:TodoTxtSortDueDateCursorPos ==? "bottom"
|
||||
silent normal G
|
||||
endif
|
||||
else
|
||||
" Default: Top of the document
|
||||
normal gg
|
||||
endif
|
||||
" TODO: add time sorting (YYYY-MM-DD HH:MM)
|
||||
endfunction
|
||||
|
||||
@@ -165,22 +297,35 @@ function! todo#HierarchicalSort(symbol, symbolsub, dolastsort)
|
||||
"Empty buffer do nothing
|
||||
return
|
||||
endif
|
||||
let g:Todo_fold_char=a:symbol
|
||||
"if the sort modes doesn't start by '!' it must start with a space
|
||||
let l:sortmode=Todo_txt_InsertSpaceIfNeeded(g:Todo_txt_first_level_sort_mode)
|
||||
let l:sortmodesub=Todo_txt_InsertSpaceIfNeeded(g:Todo_txt_second_level_sort_mode)
|
||||
let l:sortmodefinal=Todo_txt_InsertSpaceIfNeeded(g:Todo_txt_third_level_sort_mode)
|
||||
|
||||
" Count the number of lines
|
||||
" Count the number of lines
|
||||
let l:position= getpos(".")
|
||||
execute "silent normal g\<c-g>"
|
||||
let l:position= todo#GetCurpos()
|
||||
execute "silent normal G"
|
||||
let l:linecount=getpos(".")[1]
|
||||
if(exists("g:Todo_txt_debug"))
|
||||
echo "Linescount: ".l:linecount
|
||||
endif
|
||||
execute "silent normal gg"
|
||||
|
||||
" Get all the groups names
|
||||
let l:groups=GetGroups(a:symbol,1,l:linecount)
|
||||
if(exists("g:Todo_txt_debug"))
|
||||
echo "Groups: "
|
||||
echo l:groups
|
||||
echo 'execute sort'.l:sortmode.' /.\{-}\ze'.a:symbol.'/'
|
||||
endif
|
||||
" Sort by groups
|
||||
execute 'sort'.l:sortmode.' /.\{-}\ze'.a:symbol.'/'
|
||||
for l:g in l:groups
|
||||
let l:pat=a:symbol.l:g.'.*$'
|
||||
if(exists("g:Todo_txt_debug"))
|
||||
echo l:pat
|
||||
endif
|
||||
normal gg
|
||||
" Find the beginning of the group
|
||||
let l:groupBegin=search(l:pat,'c')
|
||||
@@ -209,6 +354,9 @@ function! todo#HierarchicalSort(symbol, symbolsub, dolastsort)
|
||||
endfor
|
||||
else
|
||||
" Sort by priority
|
||||
if(exists("g:Todo_txt_debug"))
|
||||
echo 'execute '.l:groupBegin.','.l:groupEnd.'sort'.l:sortmodefinal
|
||||
endif
|
||||
execute l:groupBegin.','.l:groupEnd.'sort'.l:sortmodefinal
|
||||
endif
|
||||
endif
|
||||
@@ -223,7 +371,7 @@ function! GetGroups(symbol,begin, end)
|
||||
let l:curline=a:begin
|
||||
let l:groups=[]
|
||||
while l:curline <= a:end
|
||||
while l:curline <= a:end
|
||||
let l:curproj=strpart(matchstr(getline(l:curline),a:symbol.'\S*'),len(a:symbol))
|
||||
if l:curproj != "" && index(l:groups,l:curproj) == -1
|
||||
let l:groups=add(l:groups , l:curproj)
|
||||
endif
|
||||
@@ -242,11 +390,370 @@ function! Todo_txt_InsertSpaceIfNeeded(str)
|
||||
retur a:str
|
||||
endfunction
|
||||
|
||||
" function todo#CreateNewRecurrence {{{2
|
||||
function! todo#CreateNewRecurrence(triggerOnNonStrict)
|
||||
" Given a line with a rec:timespan, create a new task based off the
|
||||
" recurrence and move the recurring tasks due:date to the next occurrence.
|
||||
"
|
||||
" This is implemented by a few other systems, so we will try to be as
|
||||
" compatible as possible with the existing specifications.
|
||||
"
|
||||
" Other example implementations:
|
||||
" <http://swiftodoapp.com/>
|
||||
" <https://github.com/bram85/todo.txt-tools/wiki/Recurrence>
|
||||
"
|
||||
|
||||
let l:currentline = getline('.')
|
||||
|
||||
" Don't operate on complete tasks
|
||||
if l:currentline =~# '^x '
|
||||
return
|
||||
endif
|
||||
|
||||
let l:rec_date_rex = '\v\c(^|\s)rec:(\+)?(\d+)([dwmy])(\s|$)'
|
||||
let l:rec_parts = matchlist(l:currentline, l:rec_date_rex)
|
||||
" Don't operate on tasks without a valid "rec:" keyword.
|
||||
if empty(l:rec_parts)
|
||||
" If a "rec:" keyword exists, but it didn't match our expectations, warn
|
||||
" the user, and abort whatever is happening otherwise a recurring task
|
||||
" might be marked complete without a new recurrence being created.
|
||||
if l:currentline =~? '\v\c(^|\s)rec:'
|
||||
throw "Recurrence pattern is invalid. Aborting operation."
|
||||
endif
|
||||
return
|
||||
endif
|
||||
|
||||
" Operations like postponing a task should not trigger the task to be
|
||||
" duplicated, non-strict mode allows the changing of the due date.
|
||||
let l:is_strict = l:rec_parts[2] ==# "+"
|
||||
if ! a:triggerOnNonStrict && ! l:is_strict
|
||||
return
|
||||
endif
|
||||
|
||||
let l:units = str2nr(l:rec_parts[3])
|
||||
if l:units < 1
|
||||
let l:units = 1
|
||||
endif
|
||||
let l:unit_type = l:rec_parts[4]
|
||||
" If we had a space on both sides of the "rec:" that we are removing, then
|
||||
" we need to insert a space, otherwise, not.
|
||||
if l:rec_parts[1] ==# ' ' && l:rec_parts[5] ==# ' '
|
||||
let l:replace_string = ' '
|
||||
else
|
||||
let l:replace_string = ''
|
||||
endif
|
||||
|
||||
" New task should have the rec: keyword stripped
|
||||
let l:newline = substitute(l:currentline, l:rec_date_rex, l:replace_string, '')
|
||||
" Insert above current line
|
||||
let l:new_task_line_num = line('.')
|
||||
if append(l:new_task_line_num - 1, l:newline) != 0
|
||||
throw "Failed at append line"
|
||||
endif
|
||||
|
||||
" At this point, we need to change the due date of the recurring task.
|
||||
" Modes:
|
||||
" Strict mode: From the existing due date
|
||||
" Non-Strict mode: From the current date
|
||||
" So, we don't need to do anything for strict mode. Non-strict mode requires
|
||||
" setting the current date.
|
||||
if l:is_strict
|
||||
call todo#ChangeDueDate(l:units, l:unit_type, '')
|
||||
else
|
||||
call todo#ChangeDueDate(l:units, l:unit_type, strftime('%Y-%m-%d'))
|
||||
endif
|
||||
|
||||
" Move onto the copied task
|
||||
call cursor(l:new_task_line_num, col('.'))
|
||||
if l:new_task_line_num != line('.')
|
||||
throw "Failed to move cursor"
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" function todo#ChangeDueDate {{{2
|
||||
function! todo#ChangeDueDate(units, unit_type, from_reference)
|
||||
" Change the due:date on the current line by a number of days, months or
|
||||
" years
|
||||
"
|
||||
" units The number of unit_type to add or subtract, integer
|
||||
" values only
|
||||
" unit_type May be one of 'd' (days), 'm' (months) or 'y' (years),
|
||||
" as handled by todo#DateAdd
|
||||
" from_reference Allows passing a different date to base the calculation
|
||||
" on, ignoring the existing due date in the line. Leave as
|
||||
" an empty string to use the due:date in the line,
|
||||
" otherwise a date as a string in the form "YYYY-MM-DD".
|
||||
|
||||
let l:currentline = getline('.')
|
||||
|
||||
" Don't operate on complete tasks
|
||||
if l:currentline =~# '^x '
|
||||
return
|
||||
endif
|
||||
|
||||
let l:dueDateRex = '\v\c(^|\s)due:\zs\d{4}\-\d{2}\-\d{2}\ze(\s|$)'
|
||||
|
||||
let l:duedate = matchstr(l:currentline, l:dueDateRex)
|
||||
if l:duedate ==# ''
|
||||
" No due date on current line, then add the due date as an offset from
|
||||
" current date. I.e. a v:count of 1 is due tomorrow, etc
|
||||
if l:currentline =~? '\v\c(^|\s)due:'
|
||||
" Has an invalid due: keyword, so don't add another, and don't
|
||||
" change the line
|
||||
return
|
||||
endif
|
||||
let l:duedate = strftime('%Y-%m-%d')
|
||||
let l:currentline .= ' due:' . l:duedate
|
||||
endif
|
||||
" If a valid reference has been passed, let's use it.
|
||||
if a:from_reference =~# '\v^\d{4}\-\d{2}\-\d{2}$'
|
||||
let l:duedate = a:from_reference
|
||||
endif
|
||||
|
||||
let l:duedate = todo#DateStringAdd(l:duedate, v:count1 * a:units, a:unit_type)
|
||||
|
||||
if setline('.', substitute(l:currentline, l:dueDateRex, l:duedate, '')) != 0
|
||||
throw "Failed to set line"
|
||||
endif
|
||||
endfunction "}}}
|
||||
|
||||
" General date calculation functions {{{1
|
||||
|
||||
" function todo#GetDaysInMonth {{{2
|
||||
function! todo#GetDaysInMonth(month, year)
|
||||
" Given a month and year, returns the number of days in the month, taking
|
||||
" leap years into consideration.
|
||||
|
||||
if index([1, 3, 5, 7, 8, 10, 12], a:month) >= 0
|
||||
return 31
|
||||
elseif index([4, 6, 9, 11], a:month) >= 0
|
||||
return 30
|
||||
else
|
||||
" February, leap year fun.
|
||||
if a:year % 4 != 0
|
||||
return 28
|
||||
elseif a:year % 100 != 0
|
||||
return 29
|
||||
elseif a:year % 400 != 0
|
||||
return 28
|
||||
else
|
||||
return 29
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" function todo#DateAdd {{{2
|
||||
function! todo#DateAdd(year, month, day, units, unit_type)
|
||||
" Add or subtract days, months or years from a date
|
||||
"
|
||||
" Date must be passed in components of year, month and day, all integers
|
||||
" units is the number of unit_type to add or subtract, integer values only
|
||||
" unit_type may be one of:
|
||||
" d days
|
||||
" w weeks, 7 days
|
||||
" m months, keeps the day of the month static except in the case
|
||||
" that the day is the last day in the month or the day is higher
|
||||
" than the number of days in the resultant month, where the result
|
||||
" will stick to the end of the month. Examples:
|
||||
" 2017-01-15 +1m 2017-02-15 +1m 2017-03-15 +1m 2017-04-15
|
||||
" 2017-01-31 +1m 2017-02-28 +1m 2017-03-31 +1m 2017-04-30
|
||||
" 2017-01-30 +1m 2017-02-28 +1m 2017-03-31
|
||||
" 2017-01-30 +2m 2017-03-30
|
||||
" y years, 12 months
|
||||
|
||||
|
||||
" It is my understanding that VIM does not have date math functionality
|
||||
" built in. Given we only have to deal with dates, and not times, it isn't
|
||||
" all that scary to roll our own - we just need to watch out for leap years.
|
||||
|
||||
" Check and clean up input
|
||||
if index(["d", "D", "w", "W", "m", "M", "y", "Y"], a:unit_type) < 0
|
||||
throw 'Invalid unit "'. a:unit_type . '" passed to todo#DateAdd()'
|
||||
endif
|
||||
|
||||
let l:d = str2nr(a:day)
|
||||
let l:m = str2nr(a:month)
|
||||
let l:y = str2nr(a:year)
|
||||
let l:i = str2nr(a:units)
|
||||
|
||||
" Years can be handled simply as 12 x months, weeks as 7 x days
|
||||
if a:unit_type ==? "y"
|
||||
let l:utype = "m"
|
||||
let l:i = l:i * 12
|
||||
elseif a:unit_type ==? "w"
|
||||
let l:utype = "d"
|
||||
let l:i = l:i * 7
|
||||
else
|
||||
let l:utype = a:unit_type
|
||||
endif
|
||||
|
||||
" Check and clean up input
|
||||
if l:m < 1
|
||||
if l:m == 0
|
||||
let l:m = str2nr(strftime('%m'))
|
||||
else
|
||||
let l:m = 1
|
||||
endif
|
||||
endif
|
||||
if l:m > 12
|
||||
if l:i < 0 && l:utype ==? "m"
|
||||
" Subtracting an invalid (high) month
|
||||
" See comments for passing a high day below. Same reason for this.
|
||||
let l:m = 13
|
||||
else
|
||||
let l:m = 12
|
||||
endif
|
||||
endif
|
||||
if l:y < 1900 " See end of function for rationale
|
||||
if l:y == 0
|
||||
let l:y = str2nr(strftime('%Y'))
|
||||
else
|
||||
let l:y = 1900
|
||||
endif
|
||||
endif
|
||||
|
||||
" Grab number of days in the month specified
|
||||
let l:daysInMonth = todo#GetDaysInMonth(l:m, l:y)
|
||||
|
||||
" Check and clean up input
|
||||
if l:d < 1
|
||||
if l:d == 0
|
||||
let l:d = str2nr(strftime('%d'))
|
||||
else
|
||||
let l:d = 1
|
||||
endif
|
||||
endif
|
||||
" Allow passing a high day, this allows subtraction to be more sane when
|
||||
" the day is out of bounds, i.e. 2017-04-80 should probably come out as
|
||||
" 2017-04-30 not 2017-04-29. Addition deals with days being out of
|
||||
" bounds (high) fine, and if days are untouched, out of bounds user
|
||||
" input is caught at the end of the function.
|
||||
" if l:d > l:daysInMonth
|
||||
" let l:d = l:daysInMonth
|
||||
" endif
|
||||
|
||||
if l:utype ==? "d"
|
||||
" Adding DAYS
|
||||
while l:i > 0
|
||||
let l:d += 1
|
||||
if l:d > l:daysInMonth
|
||||
let l:d = 1
|
||||
let l:m += 1
|
||||
if l:m > 12
|
||||
let l:m = 1
|
||||
let l:y += 1
|
||||
endif
|
||||
let l:daysInMonth = todo#GetDaysInMonth(l:m, l:y)
|
||||
endif
|
||||
let l:i -= 1
|
||||
endwhile
|
||||
" Subtracting DAYS
|
||||
while l:i < 0
|
||||
let l:d -= 1
|
||||
if l:d < 1
|
||||
let l:m -= 1
|
||||
if l:m < 1
|
||||
if l:y > 1900
|
||||
let l:m = 12
|
||||
let l:y -= 1
|
||||
else
|
||||
let l:d = 1
|
||||
let l:m = 1
|
||||
break
|
||||
endif
|
||||
endif
|
||||
let l:daysInMonth = todo#GetDaysInMonth(l:m, l:y)
|
||||
let l:d = l:daysInMonth
|
||||
endif
|
||||
let l:i += 1
|
||||
endwhile
|
||||
elseif l:utype ==? "m"
|
||||
if l:d >= l:daysInMonth
|
||||
let l:wasLastDayOfMonth = 1
|
||||
else
|
||||
let l:wasLastDayOfMonth = 0
|
||||
endif
|
||||
" Adding MONTHS
|
||||
while l:i > 0
|
||||
let l:m += 1
|
||||
if l:m > 12
|
||||
let l:m = 1
|
||||
let l:y += 1
|
||||
endif
|
||||
let l:i -= 1
|
||||
endwhile
|
||||
" Subtracting MONTHS
|
||||
while l:i < 0
|
||||
let l:m -= 1
|
||||
if l:m < 1
|
||||
if l:y > 1900
|
||||
let l:m = 12
|
||||
let l:y -= 1
|
||||
else
|
||||
let l:m = 1
|
||||
endif
|
||||
endif
|
||||
let l:i += 1
|
||||
endwhile
|
||||
let l:daysInMonth = todo#GetDaysInMonth(l:m, l:y)
|
||||
if l:wasLastDayOfMonth
|
||||
let l:d = l:daysInMonth
|
||||
endif
|
||||
endif
|
||||
|
||||
" Enforce some limits beyond which, I don't want to support.
|
||||
if l:y < 1900
|
||||
" Seeing as the date is going to be converted back to a string, dates
|
||||
" less that 1000 are bound to cause bugs. Given this is an app for tasks
|
||||
" you are doing in the here and now, I'm not supporting way back in the
|
||||
" past.
|
||||
let l:y = 1900
|
||||
let l:daysInMonth = todo#GetDaysInMonth(l:m, l:y)
|
||||
endif
|
||||
" If we mess with the year (just above), or the user passes a day higher
|
||||
" than the month, catch it here.
|
||||
if l:d > l:daysInMonth
|
||||
let l:d = l:daysInMonth
|
||||
endif
|
||||
return [l:y, l:m, l:d]
|
||||
endfunction
|
||||
|
||||
" function todo#DateStringAdd {{{2
|
||||
function! todo#DateStringAdd(date, units, unit_type)
|
||||
" A very thin overload of todo#DateAdd() that takes and returns the date as
|
||||
" a string rather than in [year, month, day] component form.
|
||||
"
|
||||
" Date must be passed in "YYYY-MM-DD" format, and is returned in this form
|
||||
" also.
|
||||
|
||||
let [l:year, l:month, l:day] = todo#ParseDate(a:date)
|
||||
let [l:year, l:month, l:day] = todo#DateAdd(l:year, l:month, l:day, a:units, a:unit_type)
|
||||
let l:resulting_date = printf('%04d', l:year) . '-' . printf('%02d', l:month) . '-' . printf('%02d', l:day)
|
||||
return l:resulting_date
|
||||
endfunction
|
||||
|
||||
" function todo#ParseDate {{{2
|
||||
function! todo#ParseDate(datestring)
|
||||
" Given a date as a string in the format "YYYY-MM-DD", split the date into a
|
||||
" list [year, month, day]
|
||||
"
|
||||
" Does not check if the date is valid other than being digits. Will throw an
|
||||
" exception if the text does not match the expected date format.
|
||||
|
||||
if a:datestring !~? '\v^(\d{4})\-(\d{2})\-(\d{2})$'
|
||||
throw "Invalid date passed '" . a:datestring . "'."
|
||||
endif
|
||||
let l:year = str2nr(strpart(a:datestring, 0, 4))
|
||||
let l:month = str2nr(strpart(a:datestring, 5, 2))
|
||||
let l:day = str2nr(strpart(a:datestring, 8, 2))
|
||||
return [l:year, l:month, l:day]
|
||||
endfunction "}}}
|
||||
|
||||
" Completion {{{1
|
||||
|
||||
" Simple keyword completion on all buffers {{{2
|
||||
function! TodoKeywordComplete(base)
|
||||
function! TodoKeywordComplete(base)
|
||||
" Search for matches
|
||||
let res = []
|
||||
for bufnr in range(1,bufnr('$'))
|
||||
let lines=getbufline(bufnr,1,"$")
|
||||
@@ -262,6 +769,29 @@ function! TodoKeywordComplete(base)
|
||||
return res
|
||||
endfunction
|
||||
|
||||
" Convert an item to the completion format and add it to the completion list
|
||||
fun! TodoAddToCompletionList(list,item,opp)
|
||||
" Create the definitive item
|
||||
let resitem={}
|
||||
let resitem.word=a:item.word
|
||||
let resitem.info=a:opp=='+'?"Projects":"Contexts"
|
||||
let resitem.info.=": ".join(a:item.related, ", ")
|
||||
\."\nBuffers: ".join(a:item.buffers, ", ")
|
||||
call add(a:list,resitem)
|
||||
endfun
|
||||
|
||||
fun! TodoCopyTempItem(item)
|
||||
let ret={}
|
||||
let ret.word=a:item.word
|
||||
if has_key(a:item, "related")
|
||||
let ret.related=[a:item.related]
|
||||
else
|
||||
let ret.related=[]
|
||||
endif
|
||||
let ret.buffers=[a:item.buffers]
|
||||
return ret
|
||||
endfun
|
||||
|
||||
" Intelligent completion for projects and Contexts {{{2
|
||||
fun! todo#Complete(findstart, base)
|
||||
if a:findstart
|
||||
@@ -282,12 +812,14 @@ fun! todo#Complete(findstart, base)
|
||||
for bufnr in range(1,bufnr('$'))
|
||||
let lines=getbufline(bufnr,1,"$")
|
||||
for line in lines
|
||||
for line in lines
|
||||
if line =~ " ".a:base
|
||||
" init temporary item
|
||||
let item={}
|
||||
let item.word=substitute(line,'.*\('.a:base.'\S*\).*','\1',"")
|
||||
let item.buffers=bufname(bufnr)
|
||||
let item.buffers=bufname(bufnr)
|
||||
if line =~ '.*\s\('.opp.'\S\S*\).*'
|
||||
let item.related=substitute(line,'.*\s\('.opp.'\S\S*\).*','\1',"")
|
||||
endif
|
||||
call add(res,item)
|
||||
endif
|
||||
endfor
|
||||
@@ -296,36 +828,28 @@ fun! todo#Complete(findstart, base)
|
||||
" Here all results are sorted in res, but we need to merge them
|
||||
let ret=[]
|
||||
if res != []
|
||||
if res != []
|
||||
let curitem={}
|
||||
let curitem.word=res[0].word
|
||||
let curitem.related=[]
|
||||
let curitem=TodoCopyTempItem(res[0])
|
||||
for it in res
|
||||
if curitem.word==it.word
|
||||
" Merge results
|
||||
" Merge results
|
||||
if has_key(it, "related") && index(curitem.related,it.related) <0
|
||||
call add(curitem.related,it.related)
|
||||
endif
|
||||
if index(curitem.buffers,it.buffers) <0
|
||||
call add(curitem.buffers,it.buffers)
|
||||
endif
|
||||
else
|
||||
else
|
||||
" Create the definitive item
|
||||
let resitem={}
|
||||
let resitem.word=curitem.word
|
||||
let resitem.info=opp=='+'?"Projects":"Contexts"
|
||||
let resitem.info.=": ".join(curitem.related, ", ")
|
||||
\."\nBuffers: ".join(curitem.buffers, ", ")
|
||||
" Add to list
|
||||
call TodoAddToCompletionList(ret,curitem,opp)
|
||||
" Init new item from it
|
||||
" Init new item from it
|
||||
let curitem.word=it.word
|
||||
let curitem.related=[it.related]
|
||||
let curitem=TodoCopyTempItem(it)
|
||||
endif
|
||||
endfor
|
||||
" Don't forget to add the list item
|
||||
call TodoAddToCompletionList(ret,curitem,opp)
|
||||
endif
|
||||
return ret
|
||||
endif
|
||||
endfun
|
||||
|
||||
|
||||
" vim: tabstop=4 shiftwidth=4 softtabstop=4 expandtab foldmethod=marker
|
||||
|
||||
442
doc/todo.txt
442
doc/todo.txt
@@ -1,114 +1,140 @@
|
||||
*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. Recurrence....................................|TodoTxt-Recurrence|
|
||||
7. Mappings......................................|TodoTxt-Mappings|
|
||||
7.1 Sort.....................................|TodoTxt-Sort|
|
||||
7.2 Priorities...............................|TodoTxt-Priorities|
|
||||
7.3 Dates....................................|TodoTxt-Dates|
|
||||
7.4 Done.txt.................................|TodoTxt-Done|
|
||||
7.5 Format...................................|TodoTxt-Format|
|
||||
8. Fold..........................................|TodoTxt-Fold|
|
||||
|
||||
===============================================================================
|
||||
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.
|
||||
V0.8.1 Incorporates yet another Fretep work : highlighting for tasks due today.
|
||||
|
||||
v0.8 Incorporates Fretep's work on overdue dates (PR#13 and PR#16) which removes
|
||||
python dependency, allow to control the cursor position after a sort by todo
|
||||
(see |TodoTxt-Sort| and/or issue #15) and fixes bug when sorting a file
|
||||
containing only lines with due:date (issue #14).
|
||||
|
||||
v0.7.6 Incorporates [Sietse's work](https://github.com/sietse/todo.txt-vim/commit/57d45200c8b033d31c9191ee0eb0711c801cdb1d) to make cancel and mark as done mapping repeatable using [vim-repeat](https://github.com/tpope/vim-repeat).
|
||||
|
||||
v0.7.5 Incorporates Fievel's work
|
||||
(https://github.com/fievel/todo.txt-vim/commit/0863e1434e9a89ace06c4856b6cb32ba9906e3de)
|
||||
to make overduedates work on python3.
|
||||
|
||||
v0.7.4 includes the overduedate support from Guilherme Victal (see pull
|
||||
request #45 on freitass version (https://github.com/freitass/todo.txt-vim/pull/45)),
|
||||
it highlight dates in overdue tasks as an Error. It depends on a
|
||||
Python library, however, and as such will only be able to work if your version
|
||||
of Vim was compiled with the `+python` option (as most common versions do).
|
||||
|
||||
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* ~
|
||||
|
||||
This plugin provides a Flexible file naming for todo.txt, all the following
|
||||
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/todotxt/todotxt/)
|
||||
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 several 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*
|
||||
|
||||
Todo.txt-vim is a filetype plugin, make sure that your vimrc contains :
|
||||
>
|
||||
syntax on
|
||||
filetype plugin on
|
||||
<
|
||||
+ 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:
|
||||
>
|
||||
YYYY-MM-[Tt]odo.txt
|
||||
@@ -127,10 +153,224 @@ 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.
|
||||
|
||||
If you don't want the preview window to open when performing completion, add the
|
||||
following lines to your vimrc:
|
||||
>
|
||||
au filetype todo setlocal completeopt-=preview
|
||||
<
|
||||
|
||||
If you would like the preview window to open even if there is only one match for
|
||||
a completion, then add the following lines to your vimrc:
|
||||
>
|
||||
au filetype todo setlocal completeopt+=menuone
|
||||
<
|
||||
|
||||
===============================================================================
|
||||
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. Recurrence *TodoTxt-Recurrence* ~
|
||||
|
||||
By adding a "rec:" tag to your task, when you complete (`<LocalLeader>x`) or
|
||||
postpone (`<LocalLeader>p`) the task, a new recurrence will be created due after
|
||||
the specified amount of time.
|
||||
|
||||
The format is:
|
||||
`rec:[+][count][d|w|m|y]`
|
||||
|
||||
Where:
|
||||
d = days, w = weeks, m = months, y = years
|
||||
The optional `+` specifies strict recurrence (see below)
|
||||
|
||||
Examples:
|
||||
* `rec:2w` - Recurs two weeks after the task is completed.
|
||||
* `rec:3d` - Recurs three days after the task is completed.
|
||||
* `rec:+1w` - Recurs one week from the due date (strict)
|
||||
|
||||
This is a non-standard but widely adopted keyword.
|
||||
===============================================================================
|
||||
7. Mappings *TodoTxt-Mappings* ~
|
||||
|
||||
By default todo-txt.vim set all the mappings described in this section. To
|
||||
prevent this behavior, add the following line to your vimrc
|
||||
>
|
||||
let g:Todo_txt_do_not_map=1
|
||||
<
|
||||
|
||||
7.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>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
|
||||
|
||||
`<LocalLeader>sd` : Sort the file on due dates. Entries with a due date appear
|
||||
sorted by at the beginning of the file, completed tasks are moved to the bottom and
|
||||
the rest of the file is not modified.
|
||||
|
||||
When you sort by due dates, at the end of the sort, your cursor will be placed
|
||||
at the top of the file. This behavior can be set with the following global
|
||||
variable :
|
||||
|
||||
let g:TodoTxtSortDueDateCursorPos = "top"
|
||||
|
||||
Possible values are :
|
||||
|
||||
+ `top` (default): The first line of the buffer, i.e. your most outstanding task
|
||||
+ `lastdue`: The last task with a due:date set
|
||||
+ `notoverdue`: The first task that is not overdue (requires #13)
|
||||
+ `bottom`: The last line of the buffer
|
||||
|
||||
7.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
|
||||
|
||||
7.3 Dates *TodoTxt-Dates*
|
||||
|
||||
`<LocalLeader>d` : Insert the current date
|
||||
|
||||
`<LocalLeader>p` : Postpone the due date (accepts a count)
|
||||
|
||||
`<LocalLeader>P` : Decrement the due date (accepts a count)
|
||||
|
||||
`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
|
||||
|
||||
If you would like the creation date (today) prefixed on new lines, add the
|
||||
following to your vimrc:
|
||||
>
|
||||
let g:Todo_txt_prefix_creation_date=1
|
||||
<
|
||||
|
||||
With insert mode maps on, typing `date<Tab>` or `due:` can feel like glitches
|
||||
This is because vim wait for mappings before inserting the words to the buffer.
|
||||
To prevent the glitches, abbreviations can be used instead of mappings.
|
||||
To turn it on, add the following to your vimrc:
|
||||
>
|
||||
let g:TodoTxtUseAbbrevInsertMode=1
|
||||
<
|
||||
|
||||
Abbreviations use word separator to expand the abbreviations, thus `<Tab>`
|
||||
is unavailable on abbreviations. Turning abbreviations mode will change
|
||||
`date<Tab>` mapping into `date:`. The resulting abbreviations would be:
|
||||
|
||||
`date:` : (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
|
||||
|
||||
For more information regarding abbreviations, see |abbreviations|
|
||||
|
||||
7.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
|
||||
|
||||
When you mark an item with a priority as done, it is assigned a priority tag
|
||||
like `pri:A` so that the priority can be restored if the item is toggled back
|
||||
to undone. If you don't want the tags showing up in your done file, you can
|
||||
disable this behavior by setting the following global variable:
|
||||
>
|
||||
let g:TodoTxtStripDoneItemPriority=1
|
||||
<
|
||||
|
||||
7.5 Format *TodoTxt-format*
|
||||
|
||||
`<LocalLeader>ff` : Try to fix todo.txt format
|
||||
|
||||
===============================================================================
|
||||
8. Fold *TodoTxt-fold* ~
|
||||
|
||||
Todo.txt files can be folded by projects or context (see |fold|), by default
|
||||
they are foldable by context, to use project fold :
|
||||
>
|
||||
|
||||
let g:Todo_fold_char='+'
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
" Author: David Beniamine <david@beniamine.net>, Leandro Freitas <freitass@gmail.com>
|
||||
" License: Vim license
|
||||
" Website: http://github.com/dbeniamine/todo.txt-vim
|
||||
" Version: 0.7.2
|
||||
|
||||
autocmd BufNewFile,BufRead [Tt]odo.txt set filetype=todo
|
||||
autocmd BufNewFile,BufRead [Tt]odo-\d\\\{4\}-\d\\\{2\}-\d\\\{2\}.txt set filetype=todo
|
||||
@@ -17,3 +16,5 @@ autocmd BufNewFile,BufRead [Dd]one-\d\\\{4\}-\d\\\{2\}.txt set filetype=todo
|
||||
autocmd BufNewFile,BufRead \d\\\{4\}-\d\\\{2\}-\d\\\{2\}-[Dd]one.txt set filetype=todo
|
||||
autocmd BufNewFile,BufRead \d\\\{4\}-\d\\\{2\}-[Dd]one.txt set filetype=todo
|
||||
autocmd BufNewFile,BufRead [Dd]one-[Tt]oday.txt set filetype=todo
|
||||
|
||||
" vim: tabstop=4 shiftwidth=4 softtabstop=4 expandtab foldmethod=marker
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
" Author: David Beniamine <David@Beniamine.net>, Leandro Freitas <freitass@gmail.com>
|
||||
" License: Vim license
|
||||
" Website: http://github.com/dbeniamine/todo.txt-vim
|
||||
" Version: 0.7.2
|
||||
" vim: ts=4 sw=4 :help tw=78 cc=80
|
||||
|
||||
if ! exists("g:Todo_txt_loaded")
|
||||
let g:Todo_txt_loaded=0.8.2
|
||||
endif
|
||||
|
||||
" Save context {{{1
|
||||
let s:save_cpo = &cpo
|
||||
@@ -12,166 +14,168 @@ set cpo&vim
|
||||
|
||||
" General options {{{1
|
||||
" Some options lose their values when window changes. They will be set every
|
||||
" time this script is invocated, which is whenever a file of this type is
|
||||
" time this script is invoked, which is whenever a file of this type is
|
||||
" created or edited.
|
||||
setlocal textwidth=0
|
||||
setlocal wrapmargin=0
|
||||
|
||||
" Increment and decrement the priority use <C-A> and <C-X> on alpha
|
||||
setlocal nrformats+=alpha
|
||||
|
||||
" Mappings {{{1
|
||||
|
||||
" 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
|
||||
" <Plug> mappings that users can map alternate keys to {{{2
|
||||
" if they choose not to map default keys (or otherwise)
|
||||
nnoremap <script> <silent> <buffer> <Plug>TodotxtIncrementDueDateNormal :<C-u>call <SID>ChangeDueDateWrapper(1, "\<Plug>TodotxtIncrementDueDateNormal")<CR>
|
||||
vnoremap <script> <silent> <buffer> <Plug>TodotxtIncrementDueDateVisual :call <SID>ChangeDueDateWrapper(1, "\<Plug>TodotxtIncrementDueDateVisual")<CR>
|
||||
nnoremap <script> <silent> <buffer> <Plug>TodotxtDecrementDueDateNormal :<C-u>call <SID>ChangeDueDateWrapper(-1, "\<Plug>TodotxtDecrementDueDateNormal")<CR>
|
||||
vnoremap <script> <silent> <buffer> <Plug>TodotxtDecrementDueDateVisual :call <SID>ChangeDueDateWrapper(-1, "\<Plug>TodotxtDecrementDueDateVisual")<CR>
|
||||
|
||||
noremap <script> <silent> <buffer> <Plug>DoToggleMarkAsDone :call todo#ToggleMarkAsDone('')<CR>
|
||||
\:silent! call repeat#set("\<Plug>DoToggleMarkAsDone")<CR>
|
||||
noremap <script> <silent> <buffer> <Plug>DoCancel :call todo#ToggleMarkAsDone('Cancelled')<CR>
|
||||
\:silent! call repeat#set("\<Plug>DoCancel")<CR>
|
||||
|
||||
" Sort tasks {{{2
|
||||
if !hasmapto("<localleader>s",'n')
|
||||
nnoremap <script> <silent> <buffer> <LocalLeader>s :call todo#Sort()<CR>
|
||||
endif
|
||||
" Default key mappings {{{2
|
||||
if !exists("g:Todo_txt_do_not_map") || ! g:Todo_txt_do_not_map
|
||||
" Sort todo by (first) context {{{3
|
||||
noremap <script> <silent> <buffer> <localleader>sc :call todo#HierarchicalSort('@', '', 1)<CR>
|
||||
noremap <script> <silent> <buffer> <localleader>scp :call todo#HierarchicalSort('@', '+', 1)<CR>
|
||||
|
||||
if !hasmapto("<LocalLeader>s@",'n')
|
||||
nnoremap <script> <silent> <buffer> <LocalLeader>s@ :sort /.\{-}\ze@/ <CR>
|
||||
endif
|
||||
" Sort todo by (first) project {{{3
|
||||
noremap <script> <silent> <buffer> <localleader>sp :call todo#HierarchicalSort('+', '',1)<CR>
|
||||
noremap <script> <silent> <buffer> <localleader>spc :call todo#HierarchicalSort('+', '@',1)<CR>
|
||||
|
||||
if !hasmapto("<LocalLeader>s+",'n')
|
||||
nnoremap <script> <silent> <buffer> <LocalLeader>s+ :sort /.\{-}\ze+/ <CR>
|
||||
endif
|
||||
" Sort tasks {{{3
|
||||
nnoremap <script> <silent> <buffer> <localleader>s :call todo#Sort("")<CR>
|
||||
nnoremap <script> <silent> <buffer> <localleader>s@ :call todo#Sort("@")<CR>
|
||||
nnoremap <script> <silent> <buffer> <localleader>s+ :call todo#Sort("+")<CR>
|
||||
|
||||
if !hasmapto("<LocalLeader>j",'n')
|
||||
nnoremap <script> <silent> <buffer> <LocalLeader>j :call todo#PrioritizeIncrease()<CR>
|
||||
endif
|
||||
" Priorities {{{3
|
||||
" TODO: Make vim-repeat work on inc/dec priority
|
||||
noremap <script> <silent> <buffer> <localleader>j :call todo#PrioritizeIncrease()<CR>
|
||||
noremap <script> <silent> <buffer> <localleader>k :call todo#PrioritizeDecrease()<CR>
|
||||
|
||||
if !hasmapto("<LocalLeader>j",'v')
|
||||
vnoremap <script> <silent> <buffer> <LocalLeader>j :call todo#PrioritizeIncrease()<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>
|
||||
noremap <script> <silent> <buffer> <localleader>n :call todo#PrioritizeAdd('N')<CR>
|
||||
noremap <script> <silent> <buffer> <localleader>w :call todo#PrioritizeAdd('W')<CR>
|
||||
|
||||
if !hasmapto("<LocalLeader>k",'n')
|
||||
nnoremap <script> <silent> <buffer> <LocalLeader>k :call todo#PrioritizeDecrease()<CR>
|
||||
endif
|
||||
" Insert date {{{3
|
||||
if get(g:, "TodoTxtUseAbbrevInsertMode", 0)
|
||||
inoreabbrev <script> <silent> <buffer> date: <C-R>=strftime("%Y-%m-%d")<CR>
|
||||
|
||||
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
|
||||
|
||||
" Insert date {{{2
|
||||
if !hasmapto("date<Tab>",'i')
|
||||
inoreabbrev <script> <silent> <buffer> due: due:<C-R>=strftime("%Y-%m-%d")<CR>
|
||||
inoreabbrev <script> <silent> <buffer> DUE: DUE:<C-R>=strftime("%Y-%m-%d")<CR>
|
||||
else
|
||||
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
|
||||
noremap <script> <silent> <buffer> <localleader>d :call todo#PrependDate()<CR>
|
||||
|
||||
if !hasmapto("<localleader>d",'v')
|
||||
vnoremap <script> <silent> <buffer> <localleader>d :call todo#PrependDate()<CR>
|
||||
endif
|
||||
" Mark done {{{3
|
||||
nmap <silent> <buffer> <localleader>x <Plug>DoToggleMarkAsDone
|
||||
|
||||
" Mark done {{{2
|
||||
if !hasmapto("<localleader>x",'n')
|
||||
nnoremap <script> <silent> <buffer> <localleader>x :call todo#ToggleMarkAsDone()<CR>
|
||||
endif
|
||||
" Mark cancelled {{{3
|
||||
nmap <silent> <buffer> <localleader>C <Plug>DoCancel
|
||||
|
||||
if !hasmapto("<localleader>x",'v')
|
||||
vnoremap <script> <silent> <buffer> <localleader>x :call todo#ToggleMarkAsDone()<CR>
|
||||
endif
|
||||
" Mark all done {{{3
|
||||
noremap <script> <silent> <buffer> <localleader>X :call todo#MarkAllAsDone()<CR>
|
||||
|
||||
" Mark all done {{{2
|
||||
if !hasmapto("<localleader>X",'n')
|
||||
nnoremap <script> <silent> <buffer> <localleader>X :call todo#MarkAllAsDone()<CR>
|
||||
endif
|
||||
|
||||
" Remove completed {{{2
|
||||
if !hasmapto("<localleader>D",'n')
|
||||
" Remove completed {{{3
|
||||
nnoremap <script> <silent> <buffer> <localleader>D :call todo#RemoveCompleted()<CR>
|
||||
|
||||
" Sort by due: date {{{3
|
||||
nnoremap <script> <silent> <buffer> <localleader>sd :call todo#SortDue()<CR>
|
||||
" try fix format {{{3
|
||||
nnoremap <script> <silent> <buffer> <localleader>ff :call todo#FixFormat()<CR>
|
||||
|
||||
" increment and decrement due:date {{{3
|
||||
nmap <silent> <buffer> <localleader>p <Plug>TodotxtIncrementDueDateNormal
|
||||
vmap <silent> <buffer> <localleader>p <Plug>TodotxtIncrementDueDateVisual
|
||||
nmap <silent> <buffer> <localleader>P <Plug>TodotxtDecrementDueDateNormal
|
||||
vmap <silent> <buffer> <localleader>P <Plug>TodotxtDecrementDueDateVisual
|
||||
|
||||
endif
|
||||
|
||||
" Sort by due: date {{{2
|
||||
if !hasmapto("<localleader>sd".'n')
|
||||
nnoremap <script> <silent> <buffer> <localleader>sd :call todo#SortDue()<CR>
|
||||
" Additional options {{{2
|
||||
" Prefix creation date when opening a new line {{{3
|
||||
if exists("g:Todo_txt_prefix_creation_date")
|
||||
nnoremap <script> <silent> <buffer> o o<C-R>=strftime("%Y-%m-%d")<CR>
|
||||
nnoremap <script> <silent> <buffer> O O<C-R>=strftime("%Y-%m-%d")<CR>
|
||||
inoremap <script> <silent> <buffer> <CR> <CR><C-R>=strftime("%Y-%m-%d")<CR>
|
||||
endif
|
||||
|
||||
" Functions for maps {{{1
|
||||
function! s:ChangeDueDateWrapper(by_days, repeat_mapping)
|
||||
call todo#CreateNewRecurrence(0)
|
||||
call todo#ChangeDueDate(a:by_days, 'd', '')
|
||||
silent! call repeat#set(a:repeat_mapping, v:count)
|
||||
endfunction
|
||||
|
||||
" Folding {{{1
|
||||
" Options {{{2
|
||||
setlocal foldmethod=expr
|
||||
setlocal foldexpr=TodoFoldLevel(v:lnum)
|
||||
setlocal foldtext=TodoFoldText()
|
||||
|
||||
" Go to first completed task
|
||||
let oldpos=getcurpos()
|
||||
if(!exists("g:Todo_fold_char"))
|
||||
let g:Todo_fold_char='@'
|
||||
let base_pos=search('^x\s', 'ce')
|
||||
" Get next completed task
|
||||
let first_incomplete = search('^\s*[^<x\s>]')
|
||||
if (first_incomplete < base_pos)
|
||||
" Check if all tasks from
|
||||
let g:Todo_fold_char='x'
|
||||
endif
|
||||
call setpos('.', oldpos)
|
||||
endif
|
||||
|
||||
function! s:get_contextproject(line) abort "{{{2
|
||||
return matchstr(getline(a:line), g:Todo_fold_char.'[^ ]\+')
|
||||
endfunction "}}}3
|
||||
|
||||
" TodoFoldLevel(lnum) {{{2
|
||||
function! TodoFoldLevel(lnum)
|
||||
" The match function returns the index of the matching pattern or -1 if
|
||||
" the pattern doesn't match. In this case, we always try to match a
|
||||
" completed task from the beginning of the line so that the matching
|
||||
" function will always return -1 if the pattern doesn't match or 0 if the
|
||||
" pattern matches. Incrementing by one the value returned by the matching
|
||||
" function we will return 1 for the completed tasks (they will be at the
|
||||
" first folding level) while for the other lines 0 will be returned,
|
||||
" indicating that they do not fold.
|
||||
return match(getline(a:lnum),'^[xX]\s.\+$') + 1
|
||||
let this_context = s:get_contextproject(a:lnum)
|
||||
let next_context = s:get_contextproject(a:lnum - 1)
|
||||
|
||||
if g:Todo_fold_char == 'x'
|
||||
" fold on cmpleted task
|
||||
return match(getline(a:lnum),'\C^x\s') + 1
|
||||
endif
|
||||
|
||||
let fold_level = 0
|
||||
|
||||
if this_context ==# next_context
|
||||
let fold_level = '1'
|
||||
else
|
||||
let fold_level = '>1'
|
||||
endif
|
||||
|
||||
return fold_level
|
||||
endfunction
|
||||
|
||||
" TodoFoldText() {{{2
|
||||
function! TodoFoldText()
|
||||
let this_context = s:get_contextproject(v:foldstart)
|
||||
if g:Todo_fold_char == 'x'
|
||||
let this_context = 'Completed tasks'
|
||||
endif
|
||||
" The text displayed at the fold is formatted as '+- N Completed tasks'
|
||||
" where N is the number of lines folded.
|
||||
return '+' . v:folddashes . ' '
|
||||
\ . (v:foldend - v:foldstart + 1)
|
||||
\ . ' Completed tasks '
|
||||
\ .' '. this_context.' '
|
||||
endfunction
|
||||
|
||||
" Restore context {{{1
|
||||
let &cpo = s:save_cpo
|
||||
" Modeline {{{1
|
||||
|
||||
" vim: tabstop=4 shiftwidth=4 softtabstop=4 expandtab foldmethod=marker
|
||||
|
||||
253
syntax/todo.vim
253
syntax/todo.vim
@@ -3,43 +3,46 @@
|
||||
" Author: David Beniamine <David@Beniamine.net>,Leandro Freitas <freitass@gmail.com>
|
||||
" License: Vim license
|
||||
" Website: http://github.com/dbeniamine/todo.txt-vim
|
||||
" Version: 0.7.2
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
syntax match TodoDone '^[xX]\s.\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext
|
||||
syntax match TodoPriorityA '^([aA])\s.\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext
|
||||
syntax match TodoPriorityB '^([bB])\s.\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext
|
||||
syntax match TodoPriorityC '^([cC])\s.\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext
|
||||
syntax match TodoPriorityD '^([dD])\s.\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext
|
||||
syntax match TodoPriorityE '^([eE])\s.\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext
|
||||
syntax match TodoPriorityF '^([fF])\s.\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext
|
||||
syntax match TodoPriorityG '^([gG])\s.\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext
|
||||
syntax match TodoPriorityH '^([hH])\s.\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext
|
||||
syntax match TodoPriorityI '^([iI])\s.\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext
|
||||
syntax match TodoPriorityJ '^([jJ])\s.\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext
|
||||
syntax match TodoPriorityK '^([kK])\s.\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext
|
||||
syntax match TodoPriorityL '^([lL])\s.\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext
|
||||
syntax match TodoPriorityM '^([mM])\s.\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext
|
||||
syntax match TodoPriorityN '^([nN])\s.\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext
|
||||
syntax match TodoPriorityO '^([oO])\s.\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext
|
||||
syntax match TodoPriorityP '^([pP])\s.\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext
|
||||
syntax match TodoPriorityQ '^([qQ])\s.\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext
|
||||
syntax match TodoPriorityR '^([rR])\s.\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext
|
||||
syntax match TodoPriorityS '^([sS])\s.\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext
|
||||
syntax match TodoPriorityT '^([tT])\s.\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext
|
||||
syntax match TodoPriorityU '^([uU])\s.\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext
|
||||
syntax match TodoPriorityV '^([vV])\s.\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext
|
||||
syntax match TodoPriorityW '^([wW])\s.\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext
|
||||
syntax match TodoPriorityX '^([xX])\s.\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext
|
||||
syntax match TodoPriorityY '^([yY])\s.\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext
|
||||
syntax match TodoPriorityZ '^([zZ])\s.\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext
|
||||
syntax match TodoDone '^[x]\s.\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext
|
||||
syntax match TodoPriorityA '^(A) .\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext,TodoDueToday,TodoOverDueDate,TodoThresholdDate,TodoTag
|
||||
syntax match TodoPriorityB '^(B) .\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext,TodoDueToday,TodoOverDueDate,TodoThresholdDate,TodoTag
|
||||
syntax match TodoPriorityC '^(C) .\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext,TodoDueToday,TodoOverDueDate,TodoThresholdDate,TodoTag
|
||||
syntax match TodoPriorityD '^(D) .\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext,TodoDueToday,TodoOverDueDate,TodoThresholdDate,TodoTag
|
||||
syntax match TodoPriorityE '^(E) .\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext,TodoDueToday,TodoOverDueDate,TodoThresholdDate,TodoTag
|
||||
syntax match TodoPriorityF '^(F) .\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext,TodoDueToday,TodoOverDueDate,TodoThresholdDate,TodoTag
|
||||
syntax match TodoPriorityG '^(G) .\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext,TodoDueToday,TodoOverDueDate,TodoThresholdDate,TodoTag
|
||||
syntax match TodoPriorityH '^(H) .\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext,TodoDueToday,TodoOverDueDate,TodoThresholdDate,TodoTag
|
||||
syntax match TodoPriorityI '^(I) .\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext,TodoDueToday,TodoOverDueDate,TodoThresholdDate,TodoTag
|
||||
syntax match TodoPriorityJ '^(J) .\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext,TodoDueToday,TodoOverDueDate,TodoThresholdDate,TodoTag
|
||||
syntax match TodoPriorityK '^(K) .\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext,TodoDueToday,TodoOverDueDate,TodoThresholdDate,TodoTag
|
||||
syntax match TodoPriorityL '^(L) .\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext,TodoDueToday,TodoOverDueDate,TodoThresholdDate,TodoTag
|
||||
syntax match TodoPriorityM '^(M) .\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext,TodoDueToday,TodoOverDueDate,TodoThresholdDate,TodoTag
|
||||
syntax match TodoPriorityN '^(N) .\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext,TodoDueToday,TodoOverDueDate,TodoThresholdDate,TodoTag
|
||||
syntax match TodoPriorityO '^(O) .\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext,TodoDueToday,TodoOverDueDate,TodoThresholdDate,TodoTag
|
||||
syntax match TodoPriorityP '^(P) .\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext,TodoDueToday,TodoOverDueDate,TodoThresholdDate,TodoTag
|
||||
syntax match TodoPriorityQ '^(Q) .\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext,TodoDueToday,TodoOverDueDate,TodoThresholdDate,TodoTag
|
||||
syntax match TodoPriorityR '^(R) .\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext,TodoDueToday,TodoOverDueDate,TodoThresholdDate,TodoTag
|
||||
syntax match TodoPriorityS '^(S) .\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext,TodoDueToday,TodoOverDueDate,TodoThresholdDate,TodoTag
|
||||
syntax match TodoPriorityT '^(T) .\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext,TodoDueToday,TodoOverDueDate,TodoThresholdDate,TodoTag
|
||||
syntax match TodoPriorityU '^(U) .\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext,TodoDueToday,TodoOverDueDate,TodoThresholdDate,TodoTag
|
||||
syntax match TodoPriorityV '^(V) .\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext,TodoDueToday,TodoOverDueDate,TodoThresholdDate,TodoTag
|
||||
syntax match TodoPriorityW '^(W) .\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext,TodoDueToday,TodoOverDueDate,TodoThresholdDate,TodoTag
|
||||
syntax match TodoPriorityX '^(X) .\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext,TodoDueToday,TodoOverDueDate,TodoThresholdDate,TodoTag
|
||||
syntax match TodoPriorityY '^(Y) .\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext,TodoDueToday,TodoOverDueDate,TodoThresholdDate,TodoTag
|
||||
syntax match TodoPriorityZ '^(Z) .\+$' contains=TodoKey,TodoDate,TodoProject,TodoContext,TodoDueToday,TodoOverDueDate,TodoThresholdDate,TodoTag
|
||||
syntax match TodoDate '\d\{2,4\}-\d\{2\}-\d\{2\}' contains=NONE
|
||||
syntax match TodoKey '\S*\S:\S\S*' contains=TodoDate
|
||||
syntax match TodoKey '\S*\S:\S\S*' contains=TodoDate
|
||||
syntax match TodoProject '\(^\|\W\)+[^[:blank:]]\+' contains=NONE
|
||||
syntax match TodoContext '\(^\|\W\)@[^[:blank:]]\+' contains=NONE
|
||||
syntax match TodoTag '\(^\|\W\)#[^[:blank:]]\+' contains=NONE
|
||||
|
||||
let s:todayDate=strftime('%Y\-%m\-%d')
|
||||
execute 'syntax match TodoDueToday /\v\c<due:' . s:todayDate . '>/ contains=NONE'
|
||||
|
||||
" Other priority colours might be defined by the user
|
||||
highlight default link TodoKey Special
|
||||
@@ -47,8 +50,200 @@ highlight default link TodoDone Comment
|
||||
highlight default link TodoPriorityA Identifier
|
||||
highlight default link TodoPriorityB statement
|
||||
highlight default link TodoPriorityC type
|
||||
highlight default link TodoPriorityN Todo
|
||||
highlight default link TodoPriorityW CursorLineNr
|
||||
highlight default link TodoDate PreProc
|
||||
highlight default link TodoProject Special
|
||||
highlight default link TodoContext Special
|
||||
highlight default link TodoTag statement
|
||||
highlight default link TodoDueToday Todo
|
||||
|
||||
function! todo#GetDateRegexForPastDates(...)
|
||||
" Build a RegExp to match all dates prior to a reference date.
|
||||
"
|
||||
" Optionally accepts a (year, month, day) for the date, otherwise assumes the
|
||||
" reference date is the current date.
|
||||
"
|
||||
" In the end, the RegExp will look something like:
|
||||
" =todo#GetDateRegexForPastDates(2017, 09, 15)
|
||||
" \v(([01]\d{3}|200\d|201[0-6])\-\d{2}\-\d{2}|(2017\-(0[0-8])\-\d{2})|(2017\-09\-0\d)|(2017\-09\-1[0-4]))
|
||||
"
|
||||
" We split the RegExp into a few alternation groups:
|
||||
" 1. All dates prior to 2000, dates before this are not supported
|
||||
" 2. All previous decades for the reference date century
|
||||
" 3. The current decade up to the year prior to the reference year
|
||||
" 4. All months for the reference year up to the end of the previous month
|
||||
" 5. Days of the month part 1.
|
||||
" 6. Days of the month part 2.
|
||||
"
|
||||
" Will not work on reference dates past 2099, or before 2000.
|
||||
"
|
||||
" Invalid months and days are not checked, i.e. 2015-14-67 will match.
|
||||
"
|
||||
" Years must be 4 digits.
|
||||
"
|
||||
|
||||
" Get the reference date
|
||||
let l:day=strftime("%d")
|
||||
let l:month=strftime("%m")
|
||||
let l:year=strftime("%Y")
|
||||
if a:0 >= 1
|
||||
let l:year=a:1
|
||||
endif
|
||||
if a:0 >= 2
|
||||
let l:month=a:2
|
||||
endif
|
||||
if a:0 >= 3
|
||||
let l:day=a:3
|
||||
endif
|
||||
|
||||
" Use very magic mode, and start an alternation
|
||||
let l:overdueRex = '\v('
|
||||
|
||||
" PART 1: 0000-1999
|
||||
" This sucker is static and won't change to year 3000. I'm not coding for the year 3000.
|
||||
let l:overdueRex = l:overdueRex . '([01]\d{3}'
|
||||
|
||||
" PART 2. All previous decades for the reference date century
|
||||
" i.e. for 2017: "200\d", for 2035: "20[0-2]\d"
|
||||
" for 2000: skip
|
||||
let l:decade = strpart(l:year, 2, 1) " i.e. the 1 from 2017
|
||||
if l:decade > 0
|
||||
let l:overdueRex = l:overdueRex . '|20'
|
||||
if l:decade > 1
|
||||
let l:overdueRex = l:overdueRex . '[0-' . (l:decade - 1) . ']'
|
||||
else
|
||||
let l:overdueRex = l:overdueRex . '0'
|
||||
endif
|
||||
let l:overdueRex = l:overdueRex . '\d'
|
||||
endif
|
||||
|
||||
" PART 3: This decade, to previous year
|
||||
" i.e. for 2017: "201[0-6]", for 2035: "203[0-4]", for 2000: skip
|
||||
let l:y = strpart(l:year, 3, 1) " Last digit of the year, i.e. 7 for 2017
|
||||
if l:y > 0
|
||||
if l:y > 1
|
||||
let l:overdueRex = l:overdueRex . '|20' . l:decade . '[0-' . (l:y - 1) . ']'
|
||||
else
|
||||
let l:overdueRex = l:overdueRex . '|20' . l:decade . '0'
|
||||
endif
|
||||
endif
|
||||
let l:overdueRex = l:overdueRex . ')\-\d{2}\-\d{2}|'
|
||||
|
||||
" PART 4: All months to the end of the previous month
|
||||
" i.e. for a date of 2017-09-07, "2017-(0[1-8])-\d{2}"
|
||||
" for 2017-10-01: "2017-(0[0-9])-\d{2}"
|
||||
" for 2017-11-30: "2017-(0\d|1[0-0])-\d{2}"
|
||||
" for 2017-12-30: "2017-(0\d|1[0-1])-\d{2}"
|
||||
" for 2017-01-20: skip
|
||||
" This only applies if the reference date is not in January
|
||||
if l:month > 1
|
||||
let l:overdueRex = l:overdueRex . '(' . l:year . '\-(0'
|
||||
if l:month > 10
|
||||
let l:overdueRex = l:overdueRex . '\d|1'
|
||||
endif
|
||||
let l:y = strpart(printf('%02d', l:month), 1, 1) " Second digit of the month
|
||||
if l:month == 10
|
||||
" When the month is 10, y = 0, and y - 1 = -1 = bad, deal with it.
|
||||
let l:y = 10
|
||||
endif
|
||||
let l:overdueRex = l:overdueRex . '[0-' . (l:y - 1) . '])\-\d{2})|'
|
||||
endif
|
||||
|
||||
" PART 5. Days of the month part 1.
|
||||
" i.e. for 2017-09-07: skip
|
||||
" for 2017-12-29: "2017-12-[0-1]\d"
|
||||
let l:y = strpart(printf('%02d', l:day), 0, 1) " First digit of the day
|
||||
if l:y > 0
|
||||
if l:y > 1
|
||||
let l:overdueRex = l:overdueRex . '(' . l:year . '\-' . printf('%02d', l:month) . '\-[0-' . (l:y - 1) . ']\d)|'
|
||||
else
|
||||
let l:overdueRex = l:overdueRex . '(' . l:year . '\-' . printf('%02d', l:month) . '\-0\d)|'
|
||||
endif
|
||||
endif
|
||||
|
||||
" PART 6. Days of the month part 2.
|
||||
" i.e. for 2017-09-07: "2017-09-0[0-6]"
|
||||
" for 2017-12-29: "2017-12-2[0-8]"
|
||||
" for 2017-09-20: skip
|
||||
let l:d = strpart(printf('%02d', l:day), 1, 1) " Last digit of the day
|
||||
if l:d > 0
|
||||
let l:y = strpart(printf('%02d', l:day), 0, 1) " First digit of the day
|
||||
let l:overdueRex = l:overdueRex . '(' . l:year . '\-' . printf('%02d', l:month) . '\-' . l:y
|
||||
if l:d > 1
|
||||
let l:overdueRex = l:overdueRex . '[0-' . (l:d - 1) . ']'
|
||||
else
|
||||
let l:overdueRex = l:overdueRex . '0'
|
||||
endif
|
||||
let l:overdueRex = l:overdueRex . ')'
|
||||
endif
|
||||
|
||||
let l:overdueRex = substitute(l:overdueRex, '|$', '', 'e')
|
||||
let l:overdueRex = l:overdueRex . ')'
|
||||
|
||||
return l:overdueRex
|
||||
endfunction
|
||||
|
||||
function! todo#GetDateRegexForFutureDates(...)
|
||||
" Get the reference date
|
||||
let l:day=strftime("%d")
|
||||
let l:month=strftime("%m")
|
||||
let l:year=strftime("%Y")
|
||||
|
||||
if a:0 >= 1
|
||||
let l:year=a:1
|
||||
endif
|
||||
if a:0 >= 2
|
||||
let l:month=a:2
|
||||
endif
|
||||
if a:0 >= 3
|
||||
let l:day=a:3
|
||||
endif
|
||||
|
||||
" Use very magic mode, and start an alternation
|
||||
let l:futureRex = '\v('
|
||||
|
||||
" Cover for all future years in the century
|
||||
let l:decade = strpart(l:year, 2, 1)
|
||||
let l:unit = strpart(l:year, 3, 1)
|
||||
|
||||
let l:futureRex = l:futureRex . '(20[' . l:decade . '-9][' . (l:unit + 1) . '-9])\-\d{2}\-\d{2}'
|
||||
|
||||
"Cover for future months in the current year
|
||||
if l:month < 9
|
||||
let l:fmonth = '(0['. (l:month + 1) . '-9]|1[0-2])'
|
||||
else
|
||||
let l:fmonth = '(' . (l:month + 1) . ')'
|
||||
endif
|
||||
let l:futureRex = l:futureRex . '|(' . l:year . '\-' . l:fmonth . '\-\d{2})'
|
||||
|
||||
"Cover for future days in the current month
|
||||
if l:day < 9
|
||||
let l:fday = '(0[' . (l:day + 1) . '-9]|[123][0-9])'
|
||||
else
|
||||
if l:day < 19
|
||||
let l:fday = '(1[' . (l:day - 9) . '-9]|[23][0-9])'
|
||||
else
|
||||
if l:day < 29
|
||||
let l:fday = '(2[' . (l:day -19) . '-9]|3[01])'
|
||||
else
|
||||
let l:fday = '(' . (l:day + 1) . ')'
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
let l:futureRex = l:futureRex . '|(' . l:year . '\-' . l:month . '\-' . l:fday . '))'
|
||||
|
||||
return l:futureRex
|
||||
|
||||
endfunction
|
||||
|
||||
execute 'syntax match TodoOverDueDate /\v\c<due:' . todo#GetDateRegexForPastDates() . '>/'
|
||||
highlight default link TodoOverDueDate Error
|
||||
|
||||
execute 'syntax match TodoThresholdDate /\v\c.*<t:' . todo#GetDateRegexForFutureDates() . '>/ contains=NONE'
|
||||
highlight default link TodoThresholdDate Comment
|
||||
|
||||
let b:current_syntax = "todo"
|
||||
|
||||
" vim: tabstop=4 shiftwidth=4 softtabstop=4 expandtab foldmethod=marker
|
||||
|
||||
17
tests/clean-vim.sh
Normal file
17
tests/clean-vim.sh
Normal file
@@ -0,0 +1,17 @@
|
||||
#/bin/bash
|
||||
|
||||
# Start a clean vim for testing development.
|
||||
|
||||
REPO_TOP=$(git rev-parse --show-toplevel)
|
||||
cd "${REPO_TOP}"
|
||||
|
||||
vim -Nu <(cat <<EOF
|
||||
filetype off
|
||||
set rtp+=~/.vim/bundle/vader.vim
|
||||
set rtp+=./
|
||||
filetype plugin indent on
|
||||
syntax enable
|
||||
autocmd filetype todo setlocal omnifunc=todo#Complete
|
||||
EOF
|
||||
) $*
|
||||
|
||||
23
tests/include/setup.vader
Normal file
23
tests/include/setup.vader
Normal file
@@ -0,0 +1,23 @@
|
||||
Execute (Clean up test environment):
|
||||
Save maplocalleader
|
||||
|
||||
let maplocalleader = '\'
|
||||
|
||||
function! ReplaceCurrentDates(expected)
|
||||
if a:expected != ''
|
||||
execute "silent! %substitute/" . a:expected . "/**EXPECTED**/"
|
||||
endif
|
||||
execute "silent! %substitute/" . strftime("%Y-%m-%d") . "/**TODAY**/"
|
||||
for b:unit in ['D', 'W', 'M', 'Y']
|
||||
let [s:year, s:month, s:day] = todo#ParseDate(strftime("%Y-%m-%d"))
|
||||
let [s:year, s:month, s:day] = todo#DateAdd(s:year, s:month, s:day, 2, b:unit)
|
||||
let s:duedate = printf('%04d', s:year) . '-' . printf('%02d', s:month) . '-' . printf('%02d', s:day)
|
||||
execute "silent! %substitute/" . s:duedate . "/**TODAY+2" . b:unit . "**/"
|
||||
endfor
|
||||
endfunction
|
||||
let g:Todo_fold_char='x'
|
||||
|
||||
Before:
|
||||
After:
|
||||
Given:
|
||||
|
||||
4
tests/include/teardown.vader
Normal file
4
tests/include/teardown.vader
Normal file
@@ -0,0 +1,4 @@
|
||||
Given:
|
||||
Execute (Restoring test environment):
|
||||
Restore
|
||||
|
||||
49
tests/runtests.sh
Normal file
49
tests/runtests.sh
Normal file
@@ -0,0 +1,49 @@
|
||||
#!/bin/bash
|
||||
|
||||
REPO_TOP=$(git rev-parse --show-toplevel)
|
||||
cd "${REPO_TOP}"
|
||||
|
||||
echo "Basic environment"
|
||||
echo "-----------------"
|
||||
vim -Nu <(cat <<EOF
|
||||
filetype off
|
||||
set rtp+=~/.vim/bundle/vader.vim
|
||||
set rtp+=./
|
||||
filetype plugin indent on
|
||||
syntax enable
|
||||
autocmd filetype todo setlocal omnifunc=todo#Complete
|
||||
EOF
|
||||
) +Vader! tests/*.vader && echo Success || exit 1
|
||||
|
||||
# Run through variations of user preferences that might mess with us.
|
||||
echo
|
||||
echo "Ignore case enabled"
|
||||
echo "-------------------"
|
||||
vim -Nu <(cat <<EOF
|
||||
filetype off
|
||||
set rtp+=~/.vim/bundle/vader.vim
|
||||
set rtp+=./
|
||||
filetype plugin indent on
|
||||
syntax enable
|
||||
autocmd filetype todo setlocal omnifunc=todo#Complete
|
||||
set ignorecase
|
||||
EOF
|
||||
) +Vader! tests/*.vader && echo Success || exit 1
|
||||
|
||||
echo
|
||||
echo "no hyphen in iskeyword"
|
||||
echo "----------------------"
|
||||
vim -Nu <(cat <<EOF
|
||||
filetype off
|
||||
set rtp+=~/.vim/bundle/vader.vim
|
||||
set rtp+=./
|
||||
filetype plugin indent on
|
||||
syntax enable
|
||||
autocmd filetype todo setlocal omnifunc=todo#Complete
|
||||
set iskeyword+=-
|
||||
EOF
|
||||
) +Vader! tests/*.vader && echo Success || exit 1
|
||||
|
||||
echo
|
||||
echo "All tests are passing."
|
||||
echo
|
||||
118
tests/todo.txt
Normal file
118
tests/todo.txt
Normal file
@@ -0,0 +1,118 @@
|
||||
x Test todo.txt file with a number of test cases from the vader unit tests for quick manual checks.
|
||||
x . 1 . 2 . 3 . 4 . 5 . 6 . 7 . 8 L01
|
||||
x 345678901234567890123456789012345678901234567890123456789012345678901234567890 L02
|
||||
x (A) Done due:2000-01-01 due:2050-01-01 2017-09-10 +Project @Context key:value L03
|
||||
Active due:2000-01-01 due:2050-01-01 2017-09-10 +Project @Context key:value L04
|
||||
x 345678901234567890123456789012345678901234567890123456789012345678901234567890 L05
|
||||
x . 1 . 2 . 3 . 4 . 5 . 6 . 7 . 8 L06
|
||||
x . 1 . 2 . 3 . 4 . 5 . 6 . 7 . 8 L01
|
||||
x 345678901234567890123456789012345678901234567890123456789012345678901234567890 L02
|
||||
(A) Priorit due:2000-01-01 due:2050-01-01 2017-09-10 +Project @Context key:value L03
|
||||
(B) Priorit due:2000-01-01 due:2050-01-01 2017-09-10 +Project @Context key:value L04
|
||||
(C) Priorit due:2000-01-01 due:2050-01-01 2017-09-10 +Project @Context key:value L05
|
||||
(D) Priorit due:2000-01-01 due:2050-01-01 2017-09-10 +Project @Context key:value L06
|
||||
(E) Priorit due:2000-01-01 due:2050-01-01 2017-09-10 +Project @Context key:value L07
|
||||
(F) Priorit due:2000-01-01 due:2050-01-01 2017-09-10 +Project @Context key:value L08
|
||||
(G) Priorit due:2000-01-01 due:2050-01-01 2017-09-10 +Project @Context key:value L09
|
||||
(H) Priorit due:2000-01-01 due:2050-01-01 2017-09-10 +Project @Context key:value L10
|
||||
(I) Priorit due:2000-01-01 due:2050-01-01 2017-09-10 +Project @Context key:value L11
|
||||
(J) Priorit due:2000-01-01 due:2050-01-01 2017-09-10 +Project @Context key:value L12
|
||||
(K) Priorit due:2000-01-01 due:2050-01-01 2017-09-10 +Project @Context key:value L13
|
||||
(L) Priorit due:2000-01-01 due:2050-01-01 2017-09-10 +Project @Context key:value L14
|
||||
(M) Priorit due:2000-01-01 due:2050-01-01 2017-09-10 +Project @Context key:value L15
|
||||
(N) Priorit due:2000-01-01 due:2050-01-01 2017-09-10 +Project @Context key:value L16
|
||||
(O) Priorit due:2000-01-01 due:2050-01-01 2017-09-10 +Project @Context key:value L17
|
||||
(P) Priorit due:2000-01-01 due:2050-01-01 2017-09-10 +Project @Context key:value L18
|
||||
(Q) Priorit due:2000-01-01 due:2050-01-01 2017-09-10 +Project @Context key:value L19
|
||||
(R) Priorit due:2000-01-01 due:2050-01-01 2017-09-10 +Project @Context key:value L20
|
||||
(S) Priorit due:2000-01-01 due:2050-01-01 2017-09-10 +Project @Context key:value L21
|
||||
(T) Priorit due:2000-01-01 due:2050-01-01 2017-09-10 +Project @Context key:value L22
|
||||
(U) Priorit due:2000-01-01 due:2050-01-01 2017-09-10 +Project @Context key:value L23
|
||||
(V) Priorit due:2000-01-01 due:2050-01-01 2017-09-10 +Project @Context key:value L24
|
||||
(W) Priorit due:2000-01-01 due:2050-01-01 2017-09-10 +Project @Context key:value L25
|
||||
(X) Priorit due:2000-01-01 due:2050-01-01 2017-09-10 +Project @Context key:value L26
|
||||
(Y) Priorit due:2000-01-01 due:2050-01-01 2017-09-10 +Project @Context key:value L27
|
||||
(Z) Priorit due:2000-01-01 due:2050-01-01 2017-09-10 +Project @Context key:value L28
|
||||
x 345678901234567890123456789012345678901234567890123456789012345678901234567890 L29
|
||||
x . 1 . 2 . 3 . 4 . 5 . 6 . 7 . 8 L30
|
||||
x . 1 . 2 . 3 . 4 . 5 . 6 . 7 . 8 L01
|
||||
x 345678901234567890123456789012345678901234567890123456789012345678901234567890 L02
|
||||
X Done tasks must start with a lowercase x then space L03
|
||||
xDone tasks must start with a lowercase x then space L04
|
||||
XDone tasks must start with a lowercase x then space L05
|
||||
(a) Priority must start with an uppercase letter in rounds followed by space L06
|
||||
(A)Priority must start with an uppercase letter in rounds followed by space L07
|
||||
A Priority must start with an uppercase letter in rounds followed by space L08
|
||||
a Priority must start with an uppercase letter in rounds followed by space L09
|
||||
Priority (A) must start with an uppercase letter in rounds followed by space L10
|
||||
due:2050-01-01 keys are valid on the start of the line L11
|
||||
due:2010-01-01 overdue dates are valid on the start of the line L12
|
||||
2010-01-01 dates are valid on the start of the line L13
|
||||
x . 1 . 2 . 3 . 4 . 5 . 6 . 7 . 8 L14
|
||||
x 345678901234567890123456789012345678901234567890123456789012345678901234567890 L15
|
||||
Invalid dates 17-10-05 20100101 01-01-2010 2010/01/01 10/01/01 2010-01-01-2010 L16
|
||||
@Contexts are valid on the start of the line L17
|
||||
+Projects are valid on the start of the line L18
|
||||
The key: syntax must be followed by a value, same for due: L19
|
||||
due: syntax must be a whole word notdue:2010-01-01 pro@jects and con+texts also L20
|
||||
x 345678901234567890123456789012345678901234567890123456789012345678901234567890 L21
|
||||
x . 1 . 2 . 3 . 4 . 5 . 6 . 7 . 8 L22
|
||||
x 2017-09-18 Complete task
|
||||
x 2017-09-18 2017-09-01 Completed task with a created date
|
||||
x 2017-09-18 (A) Completed priority task
|
||||
x 2017-09-18 2017-09-01 (A) Completed priority task with a created date
|
||||
X 2017-09-18 Not to be confused for a complete task
|
||||
Active task
|
||||
2017-09-01 Active task with a created date
|
||||
(A) Active priority task
|
||||
(A) 2017-09-01 Active priority task with a created date
|
||||
X 2017-09-18 Not to be confused for a complete task
|
||||
XNot to be confused for a complete task
|
||||
x 2017-09-18 Rules are not clear on leading whitespace, see comments in test
|
||||
Tricky incomplete task x 2017-09-18
|
||||
active dUE:2051-01-01 cAsE EXP:24 GIV:01
|
||||
overdue due:2001-01-01 EXP:02 GIV:02
|
||||
notdue overdue:2011-11-11 invalid key EXP:33 GIV:03
|
||||
overdue duE:2009-01-01 cAsE EXP:18 GIV:04
|
||||
xoverdue due:2001-02-01 This is not done (must be lower x) EXP:03 GIV:05
|
||||
overdue due:2012-01-01 \|| no tasks the between bars ||/ EXP:21 GIV:06
|
||||
x done due:2011-11-11 topmost done task EXP:44 GIV:07
|
||||
notdue due: 2011-11-11 space invalidates due: EXP:34 GIV:08
|
||||
overdue due:2005-01-01 +Project @Context EXP:10 GIV:09
|
||||
overdue due:2002-01-01 @Context EXP:04 GIV:10
|
||||
overdue due:2004-02-01 EXP:09 GIV:11
|
||||
notdue due: due:2011-MM-DD EXP:35 GIV:12
|
||||
overdue due:2000-01-01 cursor here for top, most overdue EXP:01 GIV:13
|
||||
notdue due:2011-11-1 EXP:36 GIV:14
|
||||
active due:2059-01-01 bottommost active task EXP:32 GIV:15
|
||||
overdue due:2006-01-01 EXP:12 GIV:16
|
||||
overdue due:2007-02-01 +Project EXP:15 GIV:17
|
||||
active due:2056-01-01 EXP:29 GIV:18
|
||||
notdue due:2011-1-11 EXP:37 GIV:19
|
||||
x done due:2011-11-11 EXP:45 GIV:20
|
||||
overdue dUe:2008-02-01 cAsE EXP:17 GIV:21
|
||||
X overdue due:2002-02-01 This is not done (must be lower x) EXP:05 GIV:22
|
||||
+Project overdue due:2003-02-01 project at start of line EXP:07 GIV:23
|
||||
notdue due:2011 EXP:38 GIV:24
|
||||
active DUe:2052-01-01 cAsE EXP:25 GIV:25
|
||||
overdue due:2007-01-01 EXP:14 GIV:26
|
||||
overdue Due:2008-01-01 cAsE EXP:16 GIV:27
|
||||
notdue @Project EXP:39 GIV:28
|
||||
active due:2055-01-01 EXP:28 GIV:29
|
||||
active due:2057-01-01 EXP:30 GIV:30
|
||||
overdue DuE:2009-02-01 cAsE EXP:19 GIV:31
|
||||
notdue @Context EXP:40 GIV:32
|
||||
x done due:2011-11-11 bottommost done task cursor here bottom EXP:46 GIV:33
|
||||
active DUE:2053-01-01 cAsE EXP:26 GIV:34
|
||||
active key:value due:2054-01-01 leading key:value EXP:27 GIV:35
|
||||
active due:2058-01-01 EXP:31 GIV:36
|
||||
notdue key:value EXP:41 GIV:37
|
||||
overdue due:2017-01-01 Last overdue task when sorted EXP:22 GIV:38
|
||||
overdue due:2010-12-31 /|| no tasks the between bars ||\ EXP:20 GIV:39
|
||||
active due:2050-01-01 cursor here with "notoverdue" setting EXP:23 GIV:40
|
||||
notdue due:invalid invalid due date EXP:42 GIV:41
|
||||
overdue 2011-11-11 due:2005-02-01 leading date EXP:11 GIV:42
|
||||
due:2004-01-01 overdue due: at start of line EXP:08 GIV:43
|
||||
notdue notdue:2011-11-11 invalid key EXP:43 GIV:44
|
||||
overdue due:2006-02-01 due:2011-11-11 two dates, choose first EXP:13 GIV:45
|
||||
@Context overdue due:2003-01-01 context at start of line EXP:06 GIV:46
|
||||
1409
tests/todo.vader
Normal file
1409
tests/todo.vader
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user