Shortcut to Capture Ideas



One common theme from the majority of productivity articles/books that I read is to never let use your brain to store information. Use it to generate new ideas, to solve a problem, to think.

But here is the thing: Sometimes when you are in a state of deep work, focusing on a task at hand, you might suddenly remember other tasks that you need to do later, or you might get an idea for other things that might not be related to your current task. You don’t want to break down from your deep work state, but you also don’t want to store those to-do/new information in your brain that might be forgotten 30 minutes later. For these, you need a system that could allow you to store those sudden information easily and quickly. I personally, use a text editor.

But to open a text editor program and then writing the idea down, and then saving and exiting the editor seems to be quite a repetitive process. I want to create a shortcut that automatically opens the editor and creates a new file for me. This is what I have in my setup.

Linux

For linux, it’s easy. All I need to do is just create a bash script that will open a text editor (I’m using vim) with timestamp as the filename. The code is like this

#!/bin/bash
DIRECTORY=/home/adib/notes
FNAME=$DIRECTORY/`date +'%F %T %N' | sed s/:/-/g`
EDITOR="vim -c 'startinsert'"
TERMINAL="mate-terminal"

$TERMINAL -e "$EDITOR \"$FNAME\""

Put it into somewhere that are accessible via $PATH.

Next, I just create a shortcut (for example Wn + n) to automatically run this program. Since I’m using i3, I just put it in my config file, with line:

bindsym $mod_cmd+n exec --no-startup-id qnote & 

And you are done. For other desktop environments, you might want to consult your desktop documentation or search on Google.

Windows

I’m not really familiar with Windows scripting, so I gather some information from the internet to achieve the same functionality with the bash script above. The basic step is the same, create the script and set the shortcut to quickly run that script.

@echo off
For /f "tokens=1-3 delims=/ " %%a in ('date /t') do (set mydate=%%c-%%a-%%b)
For /f "tokens=1-2 delims=/:" %%a in ('time /t') do (set mytime=%%a-%%b)

set folder=D:\notes\
set fname=%folder%%mydate% %mytime%
echo %fname%
echo. > "%fname%"
start notepad.exe "%fname%".

The above script doesn’t produce the same filename format as the bash script and also it always creates a new file even though you didn’t save anything (i.e run the script, quit the app directly). Unlike the bash script where if you didn’t save anything, no files are created.

To set up the sortcut is a little bit tricky. The best solution I came across is to use a third party application called autohotkey. After you install it, set up an autohotkey script (with extension .ahk) with content:

#NoEnv 
SendMode Input
SetWorkingDir %A_ScriptDir% 

#n::
	Run, "D:\bin\notes.bat"
	return

and then put the script into the startup directory, and viola, you are done.

Now you have a way to capture your ideas, your to-dos, and anything that capture your attention. All you need is just to click Wn+N, and an editor will be opened for you. The next step might be to synch them (notes from Windows and Linux). You could use Google Drive or syncthing if you have a private server to sync with.