Foam builds on Visual Studio Code’s powerful editing capabilities, integrating seamlessly with VS Code’s native features to create a comprehensive knowledge management experience. This guide explores how to leverage VS Code’s built-in functionality alongside Foam.
VS Code supports various keyboard shortcuts, the most important for us are:
| Shortcut | Action |
|---|---|
cmd+N |
create a new file |
cmd+S |
save the current file |
cmd+O |
open a file |
cmd+P |
use quickpick to open a file |
alt+D |
open the daily note for today |
alt+H |
open the daily note for a day |
cmd+shift+P |
invoke a command (see below) |
For more information, see the VS Code keyboard cheat sheets, where you can also see how to customize your keybindings.
Commands make VS Code extremely powerful.
To invoke a command, press cmd+shift+P and select the command you want to execute.
For example, to see the Foam graph:
cmd+shift+P to open the command barshow graphFoam: Show Graph commandAnd watch the magic unfold.
To see all foam commands, type “foam” in the command bar. For more information on commands, see commands on the VS Code site.
If you want to learn more about VS Code, check out their website.
Foam integrates with VS Code panels to provide insights into individual notes and the whole knowledge base.
Foam: links: Shows all notes that link to and from the currently active note, helping you understand connections and navigate your knowledge graphFoam: Orphaned Notes: Displays notes that have no incoming or outgoing links, helping you identify isolated content that might need better integrationTag Explorer: Shows all tags used across your workspace in a hierarchical view, see [tags] for more information on tagsFoam: Graph: Visual representation of your note connections (also available as a separate graph view)VS Code is very configurable when it comes to themes and style. Find your ideal set up by running the command Color Theme.
For more information see the VS Code documentation.
Edit multiple locations simultaneously for efficient note management:
Basic Multi-Cursor:
Alt+Click / Option+Click - Add cursor at click locationCtrl+Alt+Down / Cmd+Option+Down - Add cursor belowCtrl+Alt+Up / Cmd+Option+Up - Add cursor aboveCtrl+D / Cmd+D - Select next occurrence of wordCtrl+Shift+L / Cmd+Shift+L - Select all occurrencesBulk wikilink creation:
Ctrl+Shift+L to select all occurrences[[]] to wrap all instancesPowerful search and replace for note maintenance:
Basic Find/Replace:
Ctrl+F / Cmd+F - Find in current fileCtrl+H / Cmd+H - Replace in current fileCtrl+Shift+F / Cmd+Shift+F - Find across workspaceCtrl+Shift+H / Cmd+Shift+H - Replace across workspaceOrganize long notes with collapsible sections:
Folding Controls:
Ctrl+Shift+[ / Cmd+Option+[ - Fold current sectionCtrl+Shift+] / Cmd+Option+] - Unfold current sectionCtrl+K Ctrl+0 / Cmd+K Cmd+0 - Fold allCtrl+K Ctrl+J / Cmd+K Cmd+J - Unfold allLeverage VS Code’s file explorer for note organization:
File Operations:
Quick File Actions:
F2 - Rename file (Foam updates links automatically)Delete - Move to trashCtrl+C / Cmd+C then Ctrl+V / Cmd+V - Copy/paste filesRapid file navigation for large knowledge bases:
Quick Open Commands:
Ctrl+P / Cmd+P - Go to fileCtrl+Shift+O / Cmd+Shift+O - Go to symbol (headings in Markdown)Ctrl+T / Cmd+T - Go to symbol in workspaceCtrl+G / Cmd+G - Go to line numberSearch Patterns:
# Go to File (Ctrl+P)
machine # Finds "machine-learning.md"
proj alpha # Finds "project-alpha.md"
daily/2025 # Finds files in daily/2025 folder
# Go to Symbol (Ctrl+Shift+O)
@introduction # Jump to "Introduction" heading
@#setup # Jump to "Setup" heading
:50 # Go to line 50
Find content across your entire knowledge base:
Search Interface (Ctrl+Shift+F / Cmd+Shift+F):
Track changes to your notes over time:
Accessing Timeline:
Timeline Features:
Navigate long notes with hierarchical structure:
Outline Panel:
Track changes to your knowledge base:
Source Control Panel:
+ to stage filesGit Workflow for Notes:
Useful Git Features:
View formatted notes alongside editing:
Preview Commands:
Ctrl+Shift+V / Cmd+Shift+V - Open previewCtrl+K V / Cmd+K V - Open preview to sideDiagrams (with Mermaid extension):
```mermaid
graph TD
A[Foam Workspace] --> B[Notes]
A --> C[Templates]
A --> D[Assets]
B --> E[Wikilinks]
B --> F[Tags]
E --> G[Graph View]
```
Extend Foam’s capabilities with complementary extensions. Look for them in the VS Code Marketplace.
With VS Code mastery, explore advanced Foam topics: