DEV Community

Cover image for Setup a notes repository with basic note functionality and auto-syncing to github
Christopher Birkenhagen
Christopher Birkenhagen

Posted on

Setup a notes repository with basic note functionality and auto-syncing to github

VS Code & GitHub for Notes

Setup a notes repository with basic note functionality and auto-syncing to github.

Background

An essential tool for all projects is a good note-taking app. Normally, I use Evernote as it has excellent functionality, syncs automatically, and has support for web, mobile, windows and mac. I have used it for years, and basically keep everything there, from tax preparation planning, to cookie recipes, to important scanned documents and saved emails.

However, Evernote does not support markdown or, more importantly, code snippets. This seems like a massive oversight, but I understand it's based off of their underlying code.

To address the issue, rather than make a major change to my workflow and switch over to an entirely new platform for notes, I have adapted my other workhorse, VSCode, for coding specific note taking. The key functionality I need for coding notes are screenshot pasting and code snippets, in addition to normal text formatting and auto-syncing.

Setup:

  1. Install VSCode Extensions:

    1. Notes
    2. RunOnSave
    3. Paste Image
    4. Code Spell Checker
  2. Create a script file at path: ".auto/sync.sh"

    echo "Synching Notes"
    git pull
    git add .
    git commit -m "Sync Notes - $(date)"
    git push
    
  3. Modify permissions on your script file:

    chmod u+x ./.auto/script.sh

  4. Setup ".note" file auto-sync on save using "sync.sh".

* RunOnSave Settings:
    * Path: ".vscode/settings.json"
```
"emeraldwalk.runonsave": {
    "commands": [
        {
            "match": ".notes",
            "isAsync": true,
            "cmd": "./.auto/sync.sh"
        }
    ]
}
```
  1. Add notes in your preferred note directory structure.

Sources

Top comments (0)