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.

Technical Diversification vs Focus

I believe that there has to be a delicate balance between diversifying in the types of technologies one is familiar with and the types that one really goes deep into (the so-called T-shaped career).

Technology is growing at an exponential rate, but you cannot work all the time. You want to have time for family, friends, life and living, and for having some fun. At the same time, as the demands at work change, we have to be able to learn and adapt to new technologies and sometimes entire new technology stacks and ways of thinking. Learning new things also expands our horizons and introduces us to new ways of thinking that we didn’t think possible before.

I propose learning very selective technologies across very varied technologies. Let me explain. I propose learning a single example from many different kinds of technologies. For instance, when it comes to text/ coding editors, there are many out there. Instead of mastering the Vim + Tmux + Zsh stack along with mastering EMacs (both those stacks will get you at the same place), take a pick, and that then becomes your old school programmers’ editor that you can use in any lean, remote environment uniformly to mercilessly manipulate plain text fast. After you’ve done that, move on to an advanced IDE, such as Jetbrains CLion or IntelliJ.

Likewise, learn one todo app really well – be it Omnifocus, Wunderlist, Things, or whatever, but don’t bother learning all of them well. Learn one object oriented programming language, one mid-level language, one concurrent language, one functional language, etc. really well, but don’t read 5 books each on both Java and C#.

There are areas where you should diversify (different programming paradigms), and there are areas where you should accumulate your several thousand hours (text editor) so that you can burn those keyboard shortcuts in your fingers and make those muscle memories. Time and energy are limited resources after all, and as our lives become busier and busier, this kind of prioritization remains the only option, so that we can keep learning the right kinds of new things and keep sailing forward smoothly.

Timeboxing as a Way of Making Steady Progress

We’re all overloaded. We’re all short on time. Too much to do, too little time.

This seems to be a common complaint in today’s information age. Information workers are paid to innovate and produce new things, which means long hours at work, brainstorming and working. In turn, this often requires that they invest in their professional growth/ skill development in their personal time. Some (like me) invest in themselves anyway, because that’s one of the better things one could do with their time and energy. On top of that, self care and self nurturing (exercising, eating healthy, sleeping well) are very much required because without a fully functioning body and mind, it would be impossible to make any substantial progress or impact in any area. Then, there’s household stuff to do – cooking, laundry, cleaning, errands, etc. etc. Oh, and maybe you want to enjoy that show on Netflix with an occasional snifter on cold rainy days?

And I haven’t even talked about those of us with a family to take care of.

So how do we ensure that we make consistent progress in all the areas that we want to make progress in? How do we make sure that we don’t fall behind in anything? How can we make it so everything keeps running smoothly, in a balanced way? How do we play an equally good role in all the roles we have to play in life?

There’s a lot of articles written about busy professionals taking care of career, health, and family at the same time. For example, this one right here talks about outsourcing certain areas of your life, prioritizing what’s important, making self care non-negotiable, reducing watching TV, spending minimal time in the kitchen, etc.

The Organized Mind talks about something called ‘active sorting’ – which is a daily exercise in prioritizing and re-prioritizing what’s important. David Allen’s Getting Things Done basically advocates the same idea – write everything down, prioritize, categorize, simplify, identify atomic items, and then divide and conquer (along with a lot of other good advice). The other extreme is the concept of ‘essentialism’, demonstrated in this wonderful book, which says take on little but do a good job at it.

I agree with all those ‘productivity hacks’, but would like to emphasize a certain productivity technique here. This isn’t my invention – it’s stuff that I’ve picked up from here and there – a certain snippet read from a book, a certain paragraph read somewhere on a blog, a little bit of introspection, and a smattering of experience have culminated in the following advice.

The one important productivity hack that I want to talk about is time-boxing. It’s an indispensable technique for anybody who wants to do a bunch of things every day. The closest analog to this is the Pomodoro technique. The idea is to use some kind of a timer (on your smart device or using a Website on the computer) to block periods of time (called ‘power hours’ in Getting Results the Agile Way) and give your undivided attention to the task at hand for that period of time, eliminating all distractions.

Without such a structured time-boxed approach to incrementally tackling all tasks on your list every day, you run two risks. The first possibility is that you only spend only a few minutes on the task, because your brain is overloaded and distracted by everything else you have to do. This leads to essentially no progress on the task at hand, because you spend the few minutes just ‘warming up’ to where you left the task off last time. The other possibility is that you end up losing yourself in the task, and spend so much time that you have none left over for all the other items on your list. Time-boxing saves you from both of these potential errors. You can fully concentrate on the task at hand because you know you’re not spending either too little or too much time on the task, and that the timer will sound to announce the end of your session. And somehow psychologically, this technique also tends to make you work faster because you want to get done before the timer sounds.

Have a productive day!

Productivity Boost on Macs with Quicksilver

Here’s a quick post about enhancing your productivity in OS X. Along the lines of the Vim philosophy, that it should be easy to navigate between things and you shouldn’t need to reach out for the mouse, I’ve set up a simple workflow that I use to switch between open applications at a blazing speed.

I use Quicksilver, which is a free app for the Mac platform. It enables you to set system-wide hotkeys that don’t only open an app, but also shift focus to an already open app rather than open a new instance of it (something that annoys me endlessly with application launchers on Linux). The Mac keyboard is so structured that it’s easy to type Cmd+Option – those are the only two control keys to the right of the space bar. These two can be combined with any key to the left of the keyboard to set up a shortcut that’s easy to type with two hands. You can have a similar setup with Ctrl+Cmd+Option (to the left of the space bar) and a key to the right of the keyboard. You can pick a letter depicting an application, e.g. W for Webstorm, and use it like so: Cmd+Option+W and voilà, it comes to the foreground (or opens if not already open). The best of course is being able to use just the Ctrl key (you have mapped the Ctrl key to be used in place of Caps Lock, right??) – Ctrl+F for Finder, Ctrl+B for my browser, etc. But you also don’t want to override some of the shell shortcuts like Ctrl-a, Ctrl-c, Ctrl-c etc. Enter multiple control key combinations like the example above for Webstorm. Or you could do Ctrl+Cmd+Option+o for Omnifocus, for instance.

Attached is a screenshot of my current configuration. Set this up, and you’ll never go back to switching between apps using Exposé, Option+Tab, or the mouse ever again.

My setup with Quicksilver triggers

My setup with Quicksilver triggers

Happy app-switching!