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.*”)

coloredListsVim
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.

Advertisements

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.

Best of 2016

As is the tradition of many technologists, I am writing about some of the best things that I discovered or did in 2016. This post is a little bit late, but I discovered a lot of great things in 2016 that I believe deserve to be shared.

Total books read: 50

Best non-technical books read
Michio Kaku – The Future of the Mind: It’s nice to know what science could bring to our lives. Dr Kaku is a visionary and while I find many of his predictions very ‘out there’, he is very comprehensive in his style and claims, which makes his books a delight to consume

Best technical books read
Kenneth Reitz & Tanya Schlusser – The Hitchhiker’s Guide to Python: Best Practices for Development. While not for the beginner, if you use any modicum of Python at your day job and have been churning out code in Python for a while, I highly recommend grabbing a copy. It walks you through some of the best practices as well as the best known and highly used libraries out there, which is a must have in your toolbox

Best technical videos consumed
Kent Beck’s ‘livestorm’ about convex and concave software projects

Best new technologies discovered and used
Docker: containerization is very hot right now
WebSocket: A technology for maintaining full duplex communication between peers
Nginx: A powerful and scalable Web server

Best new languages discovered and used
Lua: A lightweight but very powerful ‘glue’ language

Best new hardware acquired and used
Pok3r keyboard (it has clear keys; and I am not sure whether I like it better than my DAS keyboard with blue keys, but it’s still pretty nice), Steelcase Gesture (finally got onto the bandwagon of expensive ergonomic ‘programmer’ chairs), Amazon Echo

Best new apps discovered and used
Productive (iOS) – a nice way to build habits – you can select one of the built-in habits or add your own, and you can select icons, frequencies, etc. It’s also nice to be able to view stats on the individual habits to see how well you’ve been doing
CleanMyMac (macOS) – does a good job of cleaning up extraneous files left over by installers and the system itself

Best new fitness videos consumed
Fittest on Earth (Netflix) – an incredible, candid look at the Crossfit lifestyle

Best new workout technique discovered and used
Zottman curls – a comprehensive arms exercise that targets both the biceps and triceps

Best new nutritional supplements discovered and used
Creatine and magnesium. I can’t believe I’ve lived this long without these. Definitely game changers

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.

Easy Ways to Help the Environment

I recently read a book on Elon Musk, in which one of the motivations behind SpaceX is revealed. That motivation is, that given that Earth might soon become uninhabitable for humans because of several reasons, we must make it easy and inexpensive to travel to other planets, with a view to eventually colonizing them. That motivation appeals to me a lot, although unfortunately for the foreseeable future I’m not going to be directly involved in any such endeavor.

Continuing this train of thought, one of the reasons contributing to the unsuitability of our home planet to sustain life any further is of course climate change. I also read Unstoppable where Bill Nye (the Science Guy) does a marvelous job of explaining how to use technology for a cleaner environment, at the same time debunking detractors and elucidating why the topic is so important. Finally, Arnold Schwarzenegger recently wrote something vehement urging people to take serious action toward ‘terminating’ climate change.

All these factors made me start looking for ways in which I can contribute every day toward the betterment of our Pale Blue Dot. It wasn’t difficult. I came upon 50 Ways to Help, a beautiful compilation of no-brainers that people can incorporate into their everyday lives in order to make a difference. While some of the suggestions aren’t very practical for my particular profession (e.g., if I shut my computers down every night instead of putting them to sleep/ hibernate, I’d be spending a ton of time every morning bringing them back to the state they were in the previous night in terms of applications open, programs running, etc. Also, I walk to work, and everything else is too far/ too inconvenient to bike, and I can’t use a bike for groceries etc.), most of them are very easy to implement.

As it stands, for now I’m resolved to regularly do the following, as my way of saying ‘thank you’ to our home in the Cosmos:

Use CFLs, don’t rinse dishes before putting them into the dishwasher, recycle as much as possible (was already doing this), eat only vegetarian some days, only launder full loads in the machine, launder on cold or warm (not hot), use fewer paper napkins, use both sides of paper, use reusable water and coffee containers, take shorter showers, take fewer baths, brush teeth without running water, use cruise control, occasionally buy second hand mechanical and electric equipment, buy local (to reduce fuel and pollution needed to get you the stuff), keep vehicles maintained, de-clutter and donate, use e-tickets, prefer downloads over compact disks (who uses optical disks anymore anyway), and go paperless

Earth is our home. And for the foreseeable future, given the current state of technology, our only home in the Cosmos. For better or for worse, Isaac Asimov’s Foundation-level civilizations spreading across galaxies, where space travel is the norm rather than the exception, do not exist, and aren’t likely to exist for a very, very, very long time to come. As Bill Nye would say, let’s treat the planet as our owned house, and not as a rental apartment. Let’s take good care of it. Only good things can come out of a pledge to do something about climate change right now, and we can all make contributions without changing much in our everyday lives.

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!

An important difference between different genres of books

Last year, I read more books cover-to-cover than I ever did before. This year, my goal is to read even more than before, and I’ve signed up for a reading challenge pledging 80 books in 2015. I’m making good progress so far. I’m at a phase where I want to consume as much information as possible, and synthesize valuable content out of it. In my pursuit of bettering myself professionally and intellectually, I’ve therefore really been doubling down on reading books, and I’ve been utilizing DRM-free PDF books (technical books, in particular related to programming/ computers, purchased from sites such as OReilly, Manning, and the Pragmatic Bookshelf), books purchased through Apple (iBooks on the iPad), and Kindle books, apart from old fashioned printed books. Most of the books I’ve been trying to read are technical books related to my profession, but many are also the latest bestsellers in non-fiction, biographies and memoirs, and occasionally novels – anything that happens to catch my attention when I’m on a book-buying spree (or whatever the ‘algorithm’ recommends).

Out of all this, I’ve noticed a trend. It seems to me that while there is a lot of technical detail in books on programming, and while there are a lot of plot twists in most novels, and while there’s a lot to the story of an individual in a biography/ autobiography/ memoir, when it comes to nonfiction books, for instance those on psychology or business, it seems to me that it’s possible to summarize the entire content from those books in ten minutes or so. Not that these books in the latter category are less voluminous than their technical/ fictional/ biographical counterparts. On the contrary, these books tend to be filled with studies, research, anecdotes, and such. Yet somehow it seems that the anecdotes don’t really add to the meat of the topic, and are dispensable in a way. Only the principal claims need to be remembered/ noted for posterity. Given this observation, and given that my objective is to maximize learning new things and not necessarily reading as many pages as possible, is it really worth investing time in the nonfiction/ business/ psychology genre at all?

For me, I think at least for the time being, going forward my focus is going to be almost exclusively on technical/ professional books. My bias might be influenced by the fact that gaining as much expertise as possible in the profession of software development/ production of technical artifacts is the most beneficial to my career in the future, as opposed to learning all the nuances of every research ever conducted to corroborate a claim in the realm of human psychology or the world of business. Yet I can’t shake off the feeling that it’s difficult to summarize content from a certain kind of books versus content from another kind of books, because in certain areas, the details are important, and in other areas, while the details might be used to support claims, they are not as important as the principal claims and might easily be forgotten with impunity.

Happy reading!