Hacker News new | past | comments | ask | show | jobs | submit login

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

I REALLY like this bash idea! Thanks!

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
  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:

    nvim  -c "+normal ggO# $(date)" -c ':s/$/\r/' -c 'se nohlsearch' notes.md
Would be interested in knowing if I can make this nicer/more efficient.

> it cracks open Emacs on the notes file, adds a timestamp, appends the optional text

Do you mind sharing how you have setup Emacs to do that? Thanks!

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."  
    (switch-to-buffer (find-file org-journal-file))  
    (let ((today (format-time-string org-journal-date-format)))  
      (unless (org-goto-local-search-headings today nil t)  
 ((lambda ()   
    (insert today)  
    (insert " "))))  

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

Love this. Running it outside of the file though is truncating my file though ?

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.

Upvoted. Trying to setup that as well

I had been following some of the set-up from "Org Mode - Organize Your Life In Plain Text!"[0].

[0] - http://doc.norang.ca/org-mode.html

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)

Ex. :label1:label2:labeln:

Any particular reason not to use hashtags? (except habit)

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.

I use vim. Doing files based on timestamps sounds smart so I might steal that.

I used just one big file right now and one thing good about it is that you can search all your notes with one command.

I also use the uuid command to tag/reference sections. Then, I can just put the cursor on the uuid and hit '*' to jump right to that spot in the file.

Had never used `*` before. Turns out it's search for the word under the cursor. Handy.

I guess that's basically what you wrote, but I had to play with it a bit to understand.

A bit of a tip: while `*` is a search for a word onward, `#` is a reverse -- a search for a word backwards. Might help sometimes

Could you explain a bit more how you tag sections?

i have this function in .vimrc that puts in an entry header with the date + time. (use it as :Entry )

  "put an entry with the date/time (for keeping plan.txt)                                                                                                                                       
  command! -nargs=* Entry call s:RunEntry()                                                                                                                                                     
  function! s:RunEntry()                                                                                                                                                                        
    let s:tm = "\n---" . strftime("%d/%m/%y %H:%M:%S") . "----------------------\n"                                                                                                             
    execute "normal! i" . s:tm                                                                                                                                                                  
    " enter insert mode because it's time  to write stuff   now.                                                                                                                                  
    call feedkeys("i")                                                                                                                                                                          

I did this too, with the date and single keyword for future reference. That's said, I have difficulty to recall the topic if I reuse the same keyword.

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.

Mine; the filename is today's date:

alias notes='nvim echo ~/notes/notes-$(date +'%Y%m%d').md'

The format being markdown gives a good syntax clue to vim.

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.

I do this too but this article makes me think that it may be better if everything u was one file folding avoids visual clutter anyway

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.

You can see the result here: https://github.com/jodavaho/bashlog

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?

Most editors allow searching all files in a directory.

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 handle this by aliasing `todo` to `vim scp://[my website]/~/todo.txt`.

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.

Wait, you can use scp as a protocol?!

Emacs' Tramp supports multiple protocols https://www.gnu.org/software/emacs/manual/html_node/tramp/Qu...

For example, to run a remote command using an inline org-mode source block:

    src_sh[:dir /ssh:host:]{some command}
Or to run code using a remote Jupyter kernel within Org-mode in Emacs:

  #+BEGIN_SRC jupyter-julia :session /ssh:ec2:/run/user/1000/jupyter/kernel-julia-0.6.json

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:

and like this:

and like this, if you need superuser rights:

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.

wow, that's incredible. learn something new everyday.

I just keep a private git repo that I push the updates to after entering them.

I've gotten to the point that anything important enough to keep around I basically just put in a git repo somewhere.

Same to me. I store the note folder to a private gitlab repo, and write a bashscript function to commit and push the note.

Two options would be: 1. put that file on dropbox or another syncing service. 2. have it on a remote server and ssh there first

I do this, with the machine being a VPS on Linode, plus an IPad 4G connectivity with Blink app to connect via MOSH almost anywhere on earth.

Logitech folio keyboard and Apple Pencil. Drawings also pushed to cloud.

Local backup to my own NAS and a S3 storage.

Works as a charm

I use text files and have for years. I use Syncthing to keep the text file available on all my machines.

Also on mobile? Which editor do you use on mobile? I like syncthing

I just put my text files in version control. Push/pull, occasionally merge when I forget.

I save these text files to my desktop, call me old school.

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.

Can you expand on your system a little bit? Do you use it from the phone too?

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.

How do you handle a file like that on mobile?

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.

not OP but I put this file on Dropbox, their mobile app has an editor that works for markdown or plain text.

I've also had success using syncthing for this if you want something self hosted.

What do you use for editing on mobile, for files synced by syncthing?

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.

[1] http://www.orgzly.com/

[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 not sure it works on stock Android.

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 believe I used an app from fdroid called Markor. Mainly because it had a nice widget, so I could keep a to do list on my home screen.

Edit: Fixed a spelling error. Also, here's a link to the app:


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.

The Dropbox web app not having that same functionality is my biggest pet peeve with the product.

this might be archaic but… i use draft mails for that. for years and all my todo lists (about six), works really well for me.

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

How can you access the Pi when you are not at home? It has a static IP?

I've been thinking about this approach .. but was unsure about how access from outside, or if I'm abroad even.

for selfhosted stuff, usually use VPN connected to home IP address using Dynamic DNS

Thanks, any special dynamic dns provider you like?

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.

Set up an email alias that cats (appends) your note to your org file.

Then, just send your notes (via sms) to the email.

If you version control it using Fossil, and it's in markdown, you can access it directly from the repo website.

You can with Github as well. And make changes to it via the website. Not on mobile though, unless you switch to the desktop site.

But you can't make changes to it online.

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.

On Android, I've been using Markor with Syncthing for years now and never had any issues.

What do you do for when you're on the go? iOS?

I’d love to implement a similar command line program for logging various on-computer activities. Thank you for sharing!

I recommend you check out https://jrnl.sh/

What about the drawings or photos -- you have any way to connect them with the relevant daily notes?

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact