Okay, I’m back again, finally, with another installment of my Text Fetish series. You can read about it here: introduction, next action format, retrieval commands.
Today, we’re going to discuss editing functions. Basically, there are two major ways of interacting with the todo.txt file. First, you can open in your handy dandy text editor. I’m a big fan of Crimson Editor, but I’ve also been looking at PSPad (for more light-weight programming stuff), but Notepad is fine as well, as well as any of the other notepad-like editors out there.
The second way to interact with your todo.txt file is by the command line, using a combination of batch files and perl scripts. I have most of my stuff in one huge perl script, with a bunch of batch scripts pointing into it. Yeah, not necessarily elegant, but works for me.
I’m going to introduce the following four commands:
na: This command tells the perl script that you want to create a new next action. All it does it output a line to you, reminding you of the proper format, and then sucks in the line that you type in, and append it to the todo.txt file.edit: This command tells the perl script that you want to edit a particular line. Note that every time the script outputs NAs to you, it prepends a number to each line, so that you can identify it. It’s important to note that this line numbers are not tied to specific next actions, i.e., just because “Get Milk” is [5] right now, doesn’t mean it will be [5] the next time you do something. This is important to remember when you start removing things from the todo.txt file. More on that later. The edit command just sucks in the new line you type in, and completely replace the old line with it.pri: This command tells the perl script that you want to change the priority of a line, either adding one, removing it, or changine it. This command prepends the relevant next action with whatever priority you assign. Priorities are just single characters - any character is okay, except for ‘x’, which tells the script that you want to remove the priority altogether.someday: This command tells the perl script that you want to demote a next action to a someday/maybe. All it does is replace the current context, e.g., @home with @someday/maybe. Note that I assume that only one context is used per next action.
Here are the commands in action. First, I’ll see what kind of next actions I’m looking at right now. (Note, it looks a lot better in the console window - the spaceing actually makes sense!)
F:MiscellaneousGTDToDoBlog>get @home=====| @home |=====F:MiscellaneousGTDToDoBlog>getall[ 1] 96 | | (!) | Win lottery!!! @anywhere e:2006-08-22[ 3] 96 | -93 | | Wash Car @errands e:2006-08-22 d:2006-08-25[ 4] 95 | -95 | | [TV] Get Eureka’s next episode (recur: every wed) @online- e:2006-08-22 s:2006-08-23 d:2006-08-23[ 6] 96 | -88 | | [p:Bills] Download transactions and balance books @online+ e:2006-08-22 d:2006-08-30[ 7] 96 | | | [p:Blog] Create fictitious todo.txt @laptop- e:2006-08-22[ 8] 96 | | | [p:Blog] Post about hotkey @online- e:2006-08-22[ 9] 96 | | | [p:Blog] Update Text Fetish #0 with links (pigpog: Publish post) @online- e:2006-08-22[ 10] 26 | | | [p:Test] Test #1 Start Date @laptop- e:2006-08-22 s:2006-10-31[ 11] 96 | -13 | | [p:Test] Test #2 Due Date @laptop- e:2006-08-22 d:2006-11-13[ 12] 96 | | | [p:Test] Test #3 No Dates @laptop- e:2006-08-22=====| Waiting |=====[ 5] 27 | | | [TV] Waiting for next Hell’s Kitchen @waiting e:2006-10-30=====| Someday |=====[ 2] 27 | | | Learn to play piano @someday/maybe e:2006-10-30
Okay, let’s add a new next action. Say I need to get milk after all.
F:MiscellaneousGTDToDoBlog>naNA Format: (!) [p:Testing] Testing @home e:t s:yyyy-mm-dd d:yyyy-mm-dd ==> [Grocery] Get milk @errands e:2006-11-26F:MiscellaneousGTDToDoBlog>get @errands=====| @errands |=====[ 3] 96 | -93 | | Wash Car @errands e:2006-08-22 d:2006-08-25[ 4] 0 | | | [Grocery] Get milk @errands e:2006-11-26
Oh wait, I also need eggs. Since I just did the get @errands command, I know that my get milk NA is on line #4. So I can edit this line to add eggs.
F:MiscellaneousGTDToDoBlog>edit 4Are you sure you want to edit the following line?line [4]: [Grocery] Get milk @errands e:2006-11-26New version of this line? (Type ‘cancel’ to cancel edit) [Grocery] Get milk and eggs @errands e:2006-11-26
Notice that there is a confirmation question for you - just in case you forgot that the line numbers can change. If you were to type in cancel, then the todo.txt file is left unchanged. This check happens with most of my commands.
Let’s say that it’s really really important for me to get milk. I’ll use the pri command to do give this next action a bit of a flag.
F:MiscellaneousGTDToDoBlog>get @errands=====| @errands (1 NAs) |=====[ 4] 0 | | | [Grocery] Get milk and eggs @errands e:2006-11-26F:MiscellaneousGTDToDoBlog>pri 4Are you sure you want to change the priority for this line?line [4]: [Grocery] Get milk and eggs @errands e:2006-11-26Priority for this line, e.g., !, A, (x to remove)? (Type ‘cancel’ to cancel this operation) !
Now let’s say that the ! priority is a bit too serious for such an errands. Let’s change it to something less exciting, say “C”. Be aware that as soon as you change a line’s priority, the ordering inside the text file is going to change. So, before trying to reprioritize it, make sure to confirm what line you’re on.
F:MiscellaneousGTDToDoBlog>get milk=====| milk (1 NAs) |=====[ 2] 0 | | (!) | [Grocery] Get milk and eggs @errands e:2006-11-26F:MiscellaneousGTDToDoBlog>pri 2Are you sure you want to change the priority for this line?line [2]: (!) [Grocery] Get milk and eggs @errands e:2006-11-26Priority for this line, e.g., !, A, (x to remove)? (Type ‘cancel’ to cancel this operation) C
But to be honest, it really shouldn’t be prioritized at all, so let’s remove the priority. Again, double check where it is.
F:MiscellaneousGTDToDoBlog>get milk=====| milk (1 NAs) |=====[ 2] 0 | | (C) | [Grocery] Get milk and eggs @errands e:2006-11-26F:MiscellaneousGTDToDoBlog>pri 2Are you sure you want to change the priority for this line?line [2]: (C) [Grocery] Get milk and eggs @errands e:2006-11-26Priority for this line, e.g., !, A, (x to remove)? (Type ‘cancel’ to cancel this operation) xF:MiscellaneousGTDToDoBlog>get milk=====| milk (1 NAs) |=====[ 4] 0 | | | [Grocery] Get milk and eggs @errands e:2006-11-26
Finally, notice that I’ve been wanting to wash my car now for something like 96 days! It’s probably time to demote this next action. I can do this with the someday command.
F:MiscellaneousGTDToDoBlog>someday 3Are you sure you want to change this line to someday/maybe?line [3]: Wash Car @errands e:2006-08-22 d:2006-08-25Comments for this line? (Type ‘cancel’ to cancel edit) Never going to get this done.F:MiscellaneousGTDToDoBlog>get @someday=====| @someday (0 NAs) |=====
Doh, I always forget that I have to use the getall command to see my @someday/maybes!
F:MiscellaneousGTDToDoBlog>getall @someday=====| @someday (ALL) |==========| Waiting |==========| Someday |=====[ 2] 27 | | | Learn to play piano @someday/maybe e:2006-10-30[ 3] 96 | | | Wash Car (2006-11-26: Never going to get this done.) @someday/maybe e:2006-08-22
Notice that the comment I added has been inserted into the Wash Car line.
And that’s all there is for simple editing functions. Next time, I’ll show how I move through the next actions, i.e., mark them done, use recurrence, and pigpogging.











