Maintain Color-Coded TODO Lists in Vim

Many Vim enthusiasts use Vim for pretty much all text manipulation in their daily lives. However, the plain text nature of this fantastic and powerful editor sometimes leaves a little left to be desired. For example, it would be nice to have your editor color code certain items in your TODO list for you, e.g. one color for items that are done in your list, another (hopefully a more provocative one) for those that aren’t done. I recently discovered a trick how to kind of make that happen in Vim, and I am sharing that here.

The first thing you need is some type of a marker in front of your rows that you want highlighted, so that Vim has a way of doing a RegEx matching against them. E.g.

[TODO] Write a blog post
[DONE] Goof off
[Nice to Have] Read a book

Here I have marked my rows with [TODO], [DONE], and [Nice to Have]

Next up, you need to invoke the following command in the command line mode:

:highlight MyGroupTodo ctermbg=red guibg=red
:let m1 = matchadd(“MyGroupTodo”, “^\[TODO.*”)
:highlight MyGroupDone ctermbg=green guibg=green ctermfg=black guifg=black
:let m2 = matchadd(“MyGroupDone”, “^\[DONE.*”)
:highlight MyGroupNTH ctermbg=cyan guibg=cyan ctermfg=black guifg=black
:let m3 = matchadd(“MyGroupNTH”, “^\[Nice to Have.*”)

Here is a screen capture of what it looks like in my current color scheme. Keep in mind that the appearance might be different based on what color scheme you currently have enabled, and you might have to change the colors of the matches to better suit your tastes and your color scheme. Furthermore, you can put these highlight and match commands in your .vimrc so that you don’t have to keep doing it over and over.

Being a visual person I appreciate colors and the ease of distinction that they provide. If that’s you, and you use Vim, then this is how you can do it. Look up :h match inside Vim for more detail. Notice that, in contrast to the example in the Vim help, I have used more specific regular expressions so that the entire line is highlighted – you might or might not want that.

A Sample use of Omnifocus for Ultimate Productivity

I have a lot of different interests, and I would like to keep improving my skills in all those areas relentlessly, for various professional and personal reasons.

I have spent a lot of time improving my productivity system that can enable me to actually make concrete, sustained progress in all those areas. Omnifocus is my tool of choice that I’ve settled upon now after trying a handful of other options. I basically follow Rachel Andrew’s suggestion (based on David Allen’s Getting Things Done), but over time I have further refined my system based on what I see/read online and what I discover about my own process and habits through weekend reflections.

My current system is as follows. Every week I’d set up weekly goals, evenly spread across areas such as tech reading, non-tech reading, health & fitness reading, problem solving practice through TopCoder and CodeWars, online courses, physical fitness goals, paperwork, goals related to improving my natural language skills, etc. etc. In the past I used to have some time set aside for all these activities every day, but it wasn’t feasible to attack all of them every day, and a lack of concrete goals resulted in me always missing things and falling behind. Then after struggling with getting everything done for a couple of years, accumulating piles of backlogs, and further inspired by Arnold Schwarzenegger (he has talked about his habit of setting goals a lot at a lot of places, in his books and during interviews), I switched to a goal oriented approach, and eventually switched completely to only using that, which in my case means setting weekly goals in all the areas I would have tried to hit every day earlier, and then try to accomplish those goals at any time during the week.

The advantages of doing this seem manifold to me – first, you have something concrete to show for it at the end of the week (e.g. finished reading this book, added that feature to that codebase, deadlifted these many pounds) rather than saying that you spent 60 hours doing ‘some stuff’ during the week. Second, it is relieving to know that there is nothing that has to happen every day, but rather that you have the freedom to accomplish the goals whenever you get/find time.

This is where Omnifocus comes in. To facilitate the above, I have set up folders, projects, and action items for all these individual goals. Some of them are one-time, some of them repeat with a given frequency (daily, weekly, monthly, quarterly, etc.). I try to use no other lists but only Omnifocus for recording/tracking everything. If I have an item that I am not sure about, or don’t know what project/context that item belongs to, I’d put it in the Omnifocus inbox, to be sorted out later. The weekly goals are reflected as flagged items in Omnifocus, which I can view all together using the context view. I use deadlines sparingly, as suggested by this post, but admittedly some items do have deadlines, and some have to be done regularly (so they implicitly have deadlines or dates associated with them). The items that are overdue or have concrete deadlines get my attention first, and then I move on to working on the flagged items set as  my weekly goals.

In addition to all of the above I have been learning to use Omnifocus contexts more effectively. For the longest time I had contexts in it that might as well just have been projects on their own – e.g. ‘coding’, ‘admin work’. But I realized that it’s better to use the location/place where you’ll get those items done reflected in the contexts. Now I have moved on to using contexts like online, offline, at-home-only, requires desk, outside, treadmill (yes, because I can watch videos from Lynda or Coursera on a treadmill!). I find it so much more effective because being able to knock out similar tasks that can all be done at a given place, in blocks of time, without context switching, is so much easier and more efficient. Finally, I also have one context called most-important-items, which helps me focus my energies on a handful of items (mostly three) at a given point in time. I got this idea from this post.

Our lives are becoming more and more information heavy, and there is a great opportunity to live a very ‘rich’ life in terms of the various things we can do. If we are organized, we can do so easily, effectively, and in a sustained manner.

Teaser for my new blog

Teaser for my new blog 🙂 Still under construction… but this is how it will look like. Taking help from Bootstrap’s CSS/JS, google-code-prettify, free icons from Picons, putting it all together in Dreamweaver and adding a blog post about some refactoring that I did for a C application.

[There will be a post here about the C refactoring]

The masterpiece

Teaser for my new blog