Managing my Notes

How one manages one’s notes is of uttermost importance. It is, after all, part of what you know, what you want to accomplish and how you want to do it. Choosing wisely may save one from many future headaches. What I call notes others call personal knowledge base. Regardless of its name, one’s system should be:

  • Powerful;
  • Easy to use;
  • Easy to improve;
  • Future proof;

Some of these requirements are obviously more important than others. The easiness of use is a component that is not very important to me, as long as it is not tremendously difficult. Vim is known as having a large learning curve, yet, I think it’s something that everyone should use, or at very least give it serious try. This character of the system will improve despite its initial value. Something which is hard at the beginning will invariably become easier as one uses it more and more. At some point, automaticity will be reached and one will no longer have to think to obtain the fruits of one’s labour. However, the easiness of use also represents something that which is easy to call and available in most circumstances. Pen and paper would fail this requirement, since I don’t have it with me most of the time and its searching capabilities are very poor at best. However having a notebook nearby is something that I do to complement my system. I like to use pen on paper to scribble around.

Other requirements make it so non free and open-source solutions are automatically removed from the candidates. It is not easy to improve a system based on closed-source software. Using such a software also makes it so it is, most likely, not future proof.

My system is thus based on an open-standard using Free Libre Open-Source Software (FLOSS). It is text based ( using both .txt and markdown files) and uses vim as its editor. It is summed up as follows:

  • Markdown files (.md) for notes;
  • Vim to edit the notes;
  • Personal script to open, create, search and link notes;
  • todo.txt as the to-do system;
  • Sync everything with Syncthing;

Markdown files for notes:

Markdown is an easy plain-text syntax language. It is almost a WYSIWYG language, or non-abreviated, What You See Is What You Get language since many editors make it so. It is easy to use, has pretty colours in pretty much all text-editors in existence and it is quiet powerful. You can do images, tables, lists, bold, italic, equations and so on and so forth. I could’ve chosen latex (.tex) as the file type for my knowledge base, but having to compile documents, search/edit .tex files and then read pdfs would make it a hassle.

Vim to edit notes:

Vim is the best editor I have used. At some point I used Sublime-Text (with a Vim plugin: neovintageous) due to vim (the GUI versions of vim) having performance issues. That no longer seems to be true or at least I can’t reproduce the issues I had in the past. Having said that, Sublime-Text still seems to lag a little less than vim, it is a tremendous text-editor. Sadly, it’s not open-source.

The advantage of Vim over most of other text-editors is one of productivity. Vim makes it easy to do things that would take much longer elsewhere. There are countless posts that tackle this throughout the internet, in a much better way than I could, so I won’t be commenting on that.

Note: I don’t actually use vim, I use neovim.

Personal notes script:

I have created a simple script which I show below. I have it on my bashrc (or rather zshrc) and use it to search, open, create, delete and link notes. It uses fzf so it is quiet powerful and fast and congruous with my way of working since it is terminal based. Its latest function (at the time of writing this) is its linking option. I just use it to create soft symlinks because I found myself searching for terms that were not found. If I have a note called “linux_commands.md” but I frequently find myself searching for “arch_shortcuts” (or whatever), then I can just do “noty -alias linux_commands.md arch_shortcuts.md” and the next time I search for “arch” that note will be easily seen and chosen.

All my notes are in the same folder. It would be easy to add different folders however. It is not something I need right now, but something I may end up doing in the future.

noty () {
	local editor=g 
	local notes_path=~/synced/notes 
	if [ -z $1 ] || [[ "$1" == "-d" ]]
	then
		note=$(ls $notes_path | fzf) 
		if [ -n "$note" ]
		then
			note=$notes_path/$note 
			if [ -z "$1" ]
			then
				$editor $note
			elif [[ "$1" == "-d" ]]
			then
				\rm -i $note
			fi
		fi
	elif [[ "$1" == "-alias" ]]
	then
		ln -s $notes_path/$2 $notes_path/$3
	elif [[ "$1" == "-n" ]]
	then
		note=$notes_path/$2 
		if [ ! -f $note ]
		then
			$editor $note
		else
			echo "A file with the same name/path already exists."
		fi
	elif [[ "$1" == "-h" ]]
	then
		echo $'noty -n for creating new note. \nnoty -d for deleting a note. \nnoty -h for this help. \nnoty -alias source_file.md new_file_link.md \nNo option to select a note and open it with your text editor.'
	else
		echo "Option not available in the function. Do \"noty -h\" for help."
	fi
}

To-do:

What is the best to-do software is a question that frequently daunts the internet. I have the final answer to that age-old dillema! It is todo.txt. To put it simply, it’s essentially a .txt file with a set of rules (check its site for the rules). You can have items, grouped by either project or tag and you can date each item. For example, I can do “@buy pasta” and “@buy an island” and then search/filter for “@buy” and both items will be found. The todo.txt is a human-readable file, in which each line is a different to-do item with (if desired) an attached project/tag/date. It hardly gets simpler than that!

It is, again, powerful, easy to use and easy to improve and/or create software to manage it. There are clients for it in every system (android, iOS, windows, Linux, macOS) so you can use it on every device you own. I use topydo on the laptop/desktop and Simpletask on android. You can then sync it using whatever you usually use.

I have also a few helper scripts for topydo, of the form:

today () {
	if [ -z "$1" ]
	then
		EDITOR=nvim topydo ls @today
	else
		EDITOR=nvim topydo add ""$@" @today"
	fi
}

I can just call “today Create a new post” and it will add that entry to the “@today” tag. I can then see the items I have tagged as “@today” by calling today, or in other words, call today to check the items my past-self deemed reasonable to tackle in the present day.

Sync everything:

My system uses open-standards and does not rely on a specific syncing option. I personally use and recommend Syncthing. It is a FLOSS alternative to Dropbox, with a minor caveat: It is decentralized and peer to peer. In my case, I have Syncthing on a Raspberry Pi which functions as a sort of central server. The Syncthing on the Raspberry Pi is connected to my Laptop, to my Desktop and to my Android. Changes I make on the laptop are thus propagated to the desktop and vice-versa. The data is yours and yours alone.

Future:

I have used this system for more than a year now and I have stopped searching for a better one. I keep on improving on it little by little, but this does tell me that it is a good system for my use case and that I will likely stick with it. There is really nothing more I need right now, but if I ever do find myself wishing for a new function, I can probably just add it without having to search and choose for something better…