My notes are written in VSCode and version controlled with git.
It’s better than (and compatible with) Obsidian. If you use Obsidian now, you just need to open your vault in VSCode and you’re good to go.
Example: VSCode Notes Tutorial
Quickstart
1: Clone the Repository
git clone git@github.com:wcygan/vscode-notes-tutorial.git
code vscode-notes-tutorial
2: Creating a New Note using VSCode Tasks
Using a VSCode Task in tasks.json, I can trigger the creation of new notes using a script called new-note.sh.
Description | Example |
---|---|
Command Palette (CMD+Shift+P) | |
Run “New Note” Task | |
Edit your new File |
Steps for Mac
- Open Visual Studio Code.
- Press
CMD+Shift+P
to open the Command Palette. - Type
Tasks: Run Task
and pressEnter
. - Select
New Note
from the list of tasks.
Steps for Windows
- Open Visual Studio Code.
- Press
Ctrl+Shift+P
to open the Command Palette. - Type
Tasks: Run Task
and pressEnter
. - Select
New Note
from the list of tasks.
Structure
I use new-note.sh
to create new notes. Here’s the script:
#!/bin/bash
# Get the current date components
Year=$(date +%Y)
Month=$(date +%m)
Day=$(date +%d)
# Create the directory structure
mkdir -p "$Year/$Month/$Day"
# Get the local time in the desired format including seconds and timezone in military time
LocalTime=$(date +"%H:%M:%S-%Z")
# Construct the file name
FileName="$LocalTime.md"
# Full path to the new file
FilePath="$Year/$Month/$Day/$FileName"
# Create the file
touch "$FilePath"
# Open the file in VSCode
code "$FilePath"
Because of this, my notes are organized by year, month, and day. Here’s an example of the structure:
$ tree
.
└── 2024
├── 10
│ ├── 19
│ │ ├── 11:00:26PM-CDT.md
│ │ └── 11:21:29PM-CDT.md
│ ├── 20
│ │ ├── 10:57:04AM-CDT.md
│ │ ├── 11:41:06AM-CDT.md
│ │ ├── 12:11:41PM-CDT.md
│ │ ├── 12:17:53AM-CDT.md
│ │ ├── 13:44:12-CDT.md
│ │ ├── 17:53:02-CDT.md
│ │ ├── 18:00:55-CDT.md
│ │ ├── 1:42:48PM-CDT.md
│ │ └── 22:08:40-CDT.md
│ ├── 23
│ │ └── 20:21:17-CDT.md
│ ├── 24
│ │ ├── 18:02:15-CDT.md
│ │ ├── 21:45:50-CDT.md
│ │ └── 23:35:50-CDT.md
│ ├── 25
│ │ ├── 00:15:32-CDT.md
│ │ ├── 08:10:31-CDT.md
│ │ ├── 08:35:39-CDT.md
│ │ ├── 08:38:44-CDT.md
│ │ └── 08:42:03-CDT.md
│ ├── 26
│ │ ├── 09:38:17-CDT.md
│ │ ├── 09:38:43-CDT.md
│ │ ├── 10:32:46-CDT.md
│ │ ├── 10:36:30-CDT.md
│ │ ├── 12:36:37-CDT.md
│ │ ├── 13:59:39-CDT.md
│ │ ├── 18:05:20-CDT.md
│ │ └── 21:54:36-CDT.md
│ ├── 27
│ │ ├── 11:51:27-CDT.md
│ │ ├── 11:56:08-CDT.md
│ │ ├── 13:18:23-CDT.md
│ │ ├── 13:18:34-CDT.md
│ │ ├── 14:51:59-CDT.md
│ │ ├── 18:24:02-CDT.md
│ │ ├── 18:28:20-CDT.md
│ │ ├── 19:27:22-CDT.md
│ │ ├── 21:30:50-CDT.md
│ │ └── 21:33:46-CDT.md
│ ├── 28
│ │ ├── 14:47:02-CDT.md
│ │ ├── 17:23:04-CDT.md
│ │ ├── 17:49:39-CDT.md
│ │ ├── 18:06:54-CDT.md
│ │ ├── 22:08:19-CDT.md
│ │ ├── 22:13:26-CDT.md
│ │ ├── 22:45:10-CDT.md
│ │ └── 23:28:48-CDT.md
│ ├── 29
│ │ ├── 00:07:17-CDT.md
│ │ ├── 00:32:21-CDT.md
│ │ ├── 08:54:37-CDT.md
│ │ ├── 09:37:08-CDT.md
│ │ ├── 09:37:28-CDT.md
│ │ ├── 22:04:38-CDT.md
│ │ ├── 22:25:06-CDT.md
│ │ ├── 22:25:49-CDT.md
│ │ └── 23:26:02-CDT.md
│ └── 31
│ ├── 20:50:07-CDT.md
│ └── 23:28:34-CDT.md
└── 11
├── 06
│ ├── 19:03:40-CST.md
│ ├── 19:10:48-CST.py
│ ├── 23:00:44-CST.md
│ └── scratch.java
├── 09
│ ├── 17:23:54-CST.md
│ ├── 19:08:25-CST.md
│ └── 19:57:47-CST.md
├── 10
│ ├── 00:16:18-CST.md
│ ├── 09:28:13-CST.md
│ ├── 09:57:22-CST.md
│ ├── 10:01:35-CST.md
│ ├── 10:42:37-CST.md
│ ├── 11:32:16-CST.md
│ ├── 11:41:20-CST.md
│ ├── 12:05:47-CST.md
│ ├── 12:57:45-CST.md
│ └── 20:42:40-CST.md
├── 11
│ ├── 00:20:25-CST.md
│ ├── 00:23:05-CST.md
│ ├── 00:24:38-CST.md
│ ├── 00:26:29-CST.md
│ ├── 00:29:37-CST.md
│ ├── 00:45:36-CST.md
│ ├── 00:51:26-CST.md
│ ├── 01:24:20-CST.md
│ ├── 01:50:56-CST.md
│ ├── 02:11:28-CST.md
│ ├── 09:08:31-CST.md
│ ├── 09:10:12-CST.md
│ ├── 09:21:15-CST.md
│ ├── 09:37:35-CST.md
│ ├── 11:38:56-CST.md
│ ├── 11:43:20-CST.md
│ ├── 12:41:43-CST.md
│ ├── 13:21:34-CST.md
│ ├── 14:08:18-CST.md
│ ├── 14:15:42-CST.md
│ ├── 14:19:34-CST.md
│ ├── 15:36:21-CST.md
│ ├── 15:47:43-CST.md
│ ├── 16:47:28-CST.md
│ └── 18:40:42-CST.md
├── 12
│ └── 23:19:12-CST.md
└── 13
├── 00:18:41-CST.md
├── 00:42:13-CST.md
├── 00:58:34-CST.md
├── 01:54:03-CST.md
├── 02:45:20-CST.md
├── 09:23:17-CST.md
├── 09:40:37-CST.md
├── 22:59:14-CST.md
├── 22:59:46-CST.md
└── 23:10:01-CST.md
Formatting
Always use Markdown for your notes. It’s easy to read and write.
If you include code, use triple backticks (```) to start and end the code block:
print("Hello, World!")
Syntax highlighting is applied based on language and can be specified after the first set of backticks (e.g. ```python).
Git
To version control your notes, treat your notes like a git repository & use basic git commands.
git add .
git commit -m "Add new note"
git push
AI
I leverage GitHub Copilot to retrieve information from my notes.
This is especially helpful at work when I need to remember specific curl
or deployment commands.