From e7de75001b485403d55c0cd077b6fbf9bf2813fe Mon Sep 17 00:00:00 2001 From: paulroub Date: Mon, 31 Jan 2011 09:34:37 -0800 Subject: [PATCH] Added alternate 't' shortcut, with 'ls' as a default action. Updated Tips and Tricks (textile) --- Tips-and-Tricks.textile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Tips-and-Tricks.textile b/Tips-and-Tricks.textile index ad1f74c..022ebd4 100644 --- a/Tips-and-Tricks.textile +++ b/Tips-and-Tricks.textile @@ -12,6 +12,20 @@ alias t='todo.sh -d /path/to/your/todo.cfg' Then you simply type @t add laundry@ from anywhere in your file tree to add a task. +*Avoid typing todo.sh every time, a variation.* Add the following to your @~/.bashrc@ file (@~/.bash_profile@ for Mac and Cygwin users): + +
+function t() { 
+  if [ $# -eq 0 ]; then
+    todo.sh -d /path/to/your/todo.cfg ls
+  else
+    todo.sh -d /path/to/your/todo.cfg $* 
+  fi
+}
+
+ +You can still type @t add laundry@ from anywhere to add a task, but now you can just type @t@ to list your current tasks. + *Hide the configuration file by renaming it @.todo.cfg@.* *Access your remote server's @todo.txt@ via ssh.* If you have a shell account on @remote.server.com@, alias your @todo.sh@ commands to do the same thing as usual but prepend @ssh username@remote.server.com@ to them. Something like: