I use a single text file, have done this for decades. I dump everything into it and don't worry too much about structure, it's an incredible resource for "remembering" minutia, things like "what was that server that i thought might have had some issues last August?" Just a quick control-S and I'm there. My current 7+ year old notes file has about 100K lines in it right now. I can tell you what I was doing last year, or the year before, on this day, in seconds.
I just type
note (maybe some text here)
and it cracks open Emacs on the notes file, adds a timestamp, appends the optional text, and then I can just type or paste something in. Nearly frictionless, that's key. Great for writing those miserable annual reviews, too (easy answers to "what have I worked on in the past year?")
I use plain old notebooks (simple blank sketchpads, or something bound like a Moleskin/Lecchturm) for meetings, interviews, walking around datacenters and so forth where a keyboard is awkward and anyway, drawings.
I've tried the EverNote/OneNote/etc. apps and none of them were as convenient or as easy to use, or as portable.
I'll toss in my setup too, which I started semi-recently and has been working well:
In my .bash_profile I essentially just `open --background -e "...$(date +%F).txt" &`.
Since I'm in the CLI daily for work, I get day-stamped files passively opened without having to think about it. It's a nice quiet reminder to keep notes throughout the day, and it all just goes into a folder in dropbox that I can trivially `grep` or add with other tools or add side-files (typically "date - stuff.ext" so they appear next to the day's notes).
Was inspired by this, threw together this hack for vim users.
#! /usr/bin/env bash
cd ~/share # or wherever
echo >> notes.txt
date >> notes.txt
if [[ $# -ne 0 ]]; then
echo $@ >> notes.txt
fi
vim "+normal Go" +startinsert notes.txt
Enough to see if this will work for me.
I also aliased this to something short so I can quickly view notes starting at the bottom:
vim "+normal G" ~/share/notes.txt
I also would like to use something similar but I wish to add new text on the top of the file (so oldest notes go to the bottom). I ended with something like this:
This isn't exactly what was asked for, but because I live in emacs I don't get much value being able invoke it from the command line. If that's ok, try this..
(defvar org-journal-file "~/Dropbox/org/engjournal.org"
"Path to OrgMode journal file.")
(defvar org-journal-date-format "<%Y-%m-%d %a %I:%M %p>"
"Date format string for journal headings.")
(defun org-journal-entry ()
"Create a new diary entry for today or append to an existing one."
(interactive)
(switch-to-buffer (find-file org-journal-file))
(widen)
(let ((today (format-time-string org-journal-date-format)))
(beginning-of-buffer)
(unless (org-goto-local-search-headings today nil t)
((lambda ()
(org-insert-heading)
(insert today)
(insert " "))))
(beginning-of-buffer)
(org-show-entry)
(org-narrow-to-subtree)
(end-of-buffer)))
(global-set-key "\C-cj" 'org-journal-entry)
So, C-cj will open the file, create a timestamp entry at the top, and narrow to the subtree. Great for creating timestamped notes. I keep a journal this way (multiple entries per day are fine), but it could be used for any note taking.
I actually work in Windows, and use an Emacs clone called Epsilon, so my tiny batch file and Eel-language customization probably won't help you. It's really just a few minutes of work in any event.
Being doing this for years also, occasionally emailing to myself as a backup, mine is at nearly 60k lines.
Top tip is to add meta tags. I suffix them with a colon to help with searching. For example, the section containing my git notes begins with this line:
Git notes: / Git: / Git commands: / Github: / Git bash:
And any time I search for something I didn't have a tag for, then I add a new one, even misspellings.
Funny how similar this one it is to mine: I use tags surrounded by colons so I can attach a few of them and grep them easily (distinguishing them from normal text contents)
I've been doing something similar to track what I do at work for just over a year. I tried keeping a home journal with a similar technique, but it didn't stick.
I have a git repo set up, and I run: "vim `date -I`", which opens a text file named for the current date (2020-02-08 today for example). Then I'll put in notes about what it is I'm currently working on.
I've come up with the convention of separating tasks with three equal signs (===) and separating updates to a single task with (--).
The main thing it's been helpful for to me, which is honestly probably why I've kept up with it, is that I'm bad about doing my daily timesheets. So once a month when our accounting lady gets after me, I'll go back through my notes and fill everything in.
That was the ethos behind the app I wrote, https://screwnotes.com - I just wanted a note taking tool that syncs everywhere and I there's only one way to add items. I don't want to wait for a product to load, or to have to make any mental decisions about organisation, due dates, or relationships between items.
I like the idea but I wish your website showed me what the app looked like and a rough idea of what features were available before I create an account.
Hi, there have been some updates to it and the landing page does have a short explanation, but I agree - something a bit more interactive would probably be better.
The app itself is something tightly coupled to having an account to operate (so no data is lost), but I might try adding in an interactive demo on the landing page so you get that feel of how it works straight away.
I'm similar, but with vimwiki. <leader>-w-<leader>-w will open an entry for today's date, so for me ~/vimwiki/diary/2020-02-08.md. `<leader>-w i` will show a list of all entries. Pretty convenient stuff. I have mine start with a template as well, with a few common headers.
Same, of course. I added some bash aliases to make it much easier to write to the file, and use markdown instead to allow tracking todos easier.
I also added a vim command to push it to github while editing. These just remove barriers to opening and syncing the file, but the concept is the same.
This is the best thing I’ve ever read. The answer has been right in front of my eyes. I’ve been searching for a good note/things to know/knowledge storage app for decades. And a single text file seems like the best option. I’ve already started transferring stuff today to a text file.
Just a thought but would't creating a new file for each year make it more maintainable? I can't imagine searching a 100k line file or scrolling through it.
I find it useful to have everything in a single buffer, it makes searching easier. Otherwise I'd have to start issuing 'grep' commands and worry about which file is which, and get clever about regular expressions when all I want is instant, friction-free access with a handful of keystrokes. Opening a file that big doesn't take long on modern hardware.
Honestly, there's not really anything to "maintain". Just a text file and some timestamps. No magic at all. Simple as dirt. That's the magic :-)
Searching visually? Yes, 100k would be impossible. But then, even one year's worth would be impossible. So you're surely using your editor's search function, and that's definitely fast enough to not care whether you've got several lifetimes' notes.
A do see a lot of people who are making date stamped files, but I can't understand why. Do you want to switch between using C-s vs dropping to command-line for grep?
It's another function though, surely harder to reach for than the normal search. What's the value in bifurcating your searching process? What do you gain?
That sounds quite elegant, but seems this is only possible if you work out of a single machine almost always. Perhaps it could be made into a service? As long as explicit effort is taken that there's absolute minimum extra effort as possible!
I've found that VIM 8's SCP does not support absolute or realpaths like SCP generally does. Thus to access the remote file at foo:/home/dotan/todo.txt or foo:~/todo.txt I would have to use `vim scp://dotan@foo/todo.txt`. Just a heads-up for anybody who wishes to try this.
Oh, that remote execution is a neat trick. Thanks!
To cover the more trivial point for the non-Emacs readers: Tramp in Emacs makes it so that there's almost no difference between opening a file (C-x C-f) like this:
The subsystem in Emacs called Tramp makes this almost transparent; you edit your remote files as if they were local. There are occasional kinks with path translation in corner-case situations, like local Emacs editing remote source files and trying to load them into remote REPL, but those are rare and can be configured away. Dired (directory manager in Emacs) also works transparently over Tramp, so this essentially replaces SCP and graphical SFTP tools for me. You can even run GDB remotely over Tramp, which is a nice trick.
But then you've only got it locally. The advantage to VCS is that you can trivially have it on multiple machines (desktop, laptop, android with termux). You can even do it between your own machines via ssh if you don't like "cloud" stuff.
Using syncthing you can trivially have it everywhere as well, with only a one-time setup and no continuous need to manually commit changes and manually sync them (unless you're using hooks for your VCS to automate that I guess).
I use syncthing for non-text files, but I keep getting conflict copies. I could probably fix that by having one node always online, but text+VCS means that conflict resolution is built in.
A repo on github handles TODO.txt files from multiple machines fine, and better than gDrive or Dropbox. VSCode is now my main editor which makes git integration simple. I can also edit the file directly on github, though never do.
Keeping my notes in a single file has worked great for me too, i can quickly find notes by searching with Vim. i split the file in sections starting with [tag<name>] (e.g. [tagvim]) which makes it easier to move between sections. Each section is a markdown list.
Funny that we all resort to the same things. I have an almost identical bash script that appends and timestamps each note, but I push it to my Dropbox account using their REST APIs instead of my local file system.
The bash script I was talking about simply curls the .txt file from Dropbox, edits/appends it, then curls it back up to Dropbox (overwriting the old copy).
Dropbox iOS app allows you to create .txt files if you absolutely need to take a note from your phone. I’m never far from my computer personally.
I also wrote a Chrome extension that does essentially the same thing as my bash script (as well as save bookmarks to Dropbox). Its caching mechanism is very convenient for writing long notes that will be edited over hours or days—if the machine goes down, they’re all stored in Chrome’s local memory the next time I boot.
Be careful about making a file like that -- one where you have to write the entire contents back to disk when you update it even though you only modified the last line or so -- too large. You're definitely better off splitting to give you more chances at not losing everything in the event that it gets corrupted. But I guess proper backups would also take care of that.
The "safe save" protocols that editors usually use to write file contents are pretty good. I've never worried about this and I've never lost a file to a mis-save, not in decades.
I don't think it's a concern. And you need to make backups anyway.
Often the "single text file" organization method is used along with a source control system like git to synchronize the file between different devices. So that helps with the backup/recovery aspect too.
I'm late to the conversation here as I've been pondering it for a few days. I'm not a very good programmer or a bash user, but I can usually understand a script when I see it.
What script or bash alias are you using to do your "note (maybe some text here)"? I'd love to be able to do something similar.
I separate my job journal from my personal journal. Job journal starts on a backed up work drive and I don't care to have mobile access to it. I must have access to my personal journal at work, or while I'm out and about and mobile is the only way.
I use orgzly [1] and configure it to "sync" to Syncthing's local folder [2] (which Syncthing then syncs). This requires write access to Syncthing's data directory though, so I'm not sure it works on stock Android.
[2] e.g. configure a "directory repository" with content://com.android.externalstorage.documents/tree/<device id>%3AAndroid%2Fdata%2Fcom.nutomic.syncthingandroid%2Ffiles%2FSync%2Forg
I'm running a stock Pixel 2 and I've been using syncthing to sync pictures and videos to my desktop automatically, but didn't know about Orgzly. I just hooked up Orgzly and syncthing and it worked without any issues. Thanks for commenting about orgzly!
I open drafts in Gmail with no recipient and keep notes there. Super convenient since I usually have it open anyway on the desktop, it works great on mobile too, and gmail search makes it easy to find stuff.
I've been doing the same for about 15 years, except I actually send the emails to myself and have a special tag for them. Unfortunately, Gmail search has failed to find things for me in recent years that I know are there and know are tagged with a particular key phrase, usually for things that are from the 2009-2013 time period. I've lost faith that they are actually keeping everything, or perhaps that they are keeping everything but their search algorithm may sometimes return "no results" in order to be fast instead of actually falling back to some kind of deep search.
The one downside to this is that if you accidentally delete a draft (with a mistaken mouse click on the trash icon), it is impossible to ever recover the draft.
> it cracks open Emacs on the notes file, adds a timestamp, appends the optional text, and then I can just type or paste something in.
Do you do that with a shell script or an elisp function? Either way, I'd be interested in taking a look at your implementation if you don't mind sharing.
I just implemented something very similar last week! I store the note in a Raspberry Pi which I can access anywhere. Also with iOS shortcut, I can easily send note to my Pi from my iPhone's clipboard.
Any thoughts on how to access/modify on mobile without making it too cumbersome? I often think about todo on walk/train, but could see making it a computer only thing.
Absurdly, comically simple is the way to go. In these situations I usually just send myself an email, or write something down in the current physical notebook.
About 20 years ago I spent a while writing a server to do a bunch of automation and reminding and so forth, and found that I was spending more time on that thing than I was doing real work, so I ditched it, just like I did OneNote and all the other apps. There's no need to fix bugs in a text file, nor do you need to upgrade your version of Python or whatever.
Simple will survive decades with zero effort. Complicated pieces of code (especially ones that use networking or browser tech) will need to be maintained, patched, debugged and ported. Life is short. I'd rather actually be productive than have to spend time keeping some productivity app running, or worrying if the vendor of the online notes app I chose to use is going to be bought by Oracle or something.
You're making me think that the even absurder method is to use mail drafts as your files. Everything is synced between all your devices, you have built-in modification date, a full editor in the web version or applications for a more integrated experience, high portability and backup (transferring from IMAP account to IMAP account is easy), labels and/or folders depending on your provider, efficient search, attachments...
Actually in the past I used my email account as my RSS reader. It had integrated read/non read status, mass "mark as read" as needed, was synced on all platforms I cared about without anything to install. I didn't really changed my subscriptions a lot so configuration was not complicated.
Sometimes a webmail is just a good enough UI for text-related things.
Depends. You're right if you use a conventional version control approach where you write on your local machine and then push to the server. But that's not the only way to use Fossil to store your notes.
If you're using the wiki (using one or more wiki pages) everything is entered into the browser whether online or using the built-in server running locally. Other options are to create an issue for each note or create a new forum thread for each note. The nice thing about these options is that you get the search and querying power of an sqlite database applied to your notes for free.
Disclaimer: I haven't used this approach because I don't use mobile devices for note taking. Just pointing out that it is possible.
I just type
and it cracks open Emacs on the notes file, adds a timestamp, appends the optional text, and then I can just type or paste something in. Nearly frictionless, that's key. Great for writing those miserable annual reviews, too (easy answers to "what have I worked on in the past year?")I use plain old notebooks (simple blank sketchpads, or something bound like a Moleskin/Lecchturm) for meetings, interviews, walking around datacenters and so forth where a keyboard is awkward and anyway, drawings.
I've tried the EverNote/OneNote/etc. apps and none of them were as convenient or as easy to use, or as portable.