Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> I’d like a command line way to just create a new note in one line that gets stuck somewhere

5 min hackjob that saves my day every day:

    # `note foobar` opens vim on a timestamped foobar file within a folder
    # `note` just opens the same folder in netrw
    # also, using tpope/vim-vinegar and liberal use of `-` to go back and forth
    function note() (
      local title="$1"
      local timestamp="$(date +%Y-%m-%dT%H:%M:%S%z)"
      local dir="${HOME}/Dropbox/Notes"

      mkdir -p "${dir}"
      cd "${dir}"
      if [[ -n $1 ]]; then
        exec vim "$timestamp-$title.md"
      else
        exec vim .
      fi
    )



Thumbs up. I would just add the encryption filter, like gpg to yourself or within the editor automatic decryption and encryption.

You can also add your own file type if necessary.


Good point and easy enough to add, although it does not fit my use case: I want the files to be readable on mobile, plus I only put non-confidential, to-be-public, or already public data in there.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: