camscortex

Using Foam with VS Code Features

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.

Keyboard shortcuts

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

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:

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

Panels

Foam integrates with VS Code panels to provide insights into individual notes and the whole knowledge base.

Styling and Themes

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.

Multi-Cursor Editing

Edit multiple locations simultaneously for efficient note management:

Basic Multi-Cursor:

Bulk wikilink creation:

  1. Select a word (e.g., “Python”)
  2. Press Ctrl+Shift+L to select all occurrences
  3. Type [[]] to wrap all instances
  4. Arrow key to position cursor inside brackets

Find and Replace

Powerful search and replace for note maintenance:

Basic Find/Replace:

Text Folding

Organize long notes with collapsible sections:

Folding Controls:

File Management

Explorer Integration

Leverage VS Code’s file explorer for note organization:

File Operations:

Quick File Actions:

Quick Open

Rapid file navigation for large knowledge bases:

Quick Open Commands:

Search 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

Search and Discovery

Find content across your entire knowledge base:

Search Interface (Ctrl+Shift+F / Cmd+Shift+F):

Timeline View

Track changes to your notes over time:

Accessing Timeline:

  1. Open Explorer panel
  2. Expand “Timeline” section at bottom
  3. Select a file to see its change history
  4. Click timeline entries to see diff views

Timeline Features:

Outline View

Navigate long notes with hierarchical structure:

Outline Panel:

  1. Enable in Explorer (expand “Outline” section)
  2. Shows heading hierarchy for current note
  3. Click headings to jump to sections
  4. Collapse/expand sections in outline

Version Control Integration

Git Integration

Track changes to your knowledge base:

Source Control Panel:

Git Workflow for Notes:

  1. Write and edit your notes
  2. Review changes in Source Control panel
  3. Stage relevant files for commit
  4. Write meaningful commit message
  5. Commit and push to backup/share

Useful Git Features:

Markdown Features

Preview Integration

View formatted notes alongside editing:

Preview Commands:

Diagrams (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]
```

Extension Ecosystem

Extend Foam’s capabilities with complementary extensions. Look for them in the VS Code Marketplace.

What’s Next?

With VS Code mastery, explore advanced Foam topics:

  1. [recommended-extensions] - See complementary extensions to improve your note taking experience
  2. [publishing] - Share your knowledge base