コンテンツにスキップ

Logseq Cheat Sheet

Overview

Logseq is an open-source, local-first knowledge management and note-taking application built around an outliner workflow. It supports bidirectional linking, block references, and a powerful graph view that visualizes relationships between your notes. All data is stored as plain Markdown or Org-mode files on your local filesystem, giving you full ownership of your data.

Logseq excels at building a personal knowledge graph where ideas connect organically. It supports plugins, themes, PDF annotation, flashcards via spaced repetition, and queries that pull information dynamically from across your entire graph. It runs on desktop (Windows, macOS, Linux) and mobile (iOS, Android).

Installation

Desktop (All Platforms)

# macOS via Homebrew
brew install --cask logseq

# Linux via AppImage
wget https://github.com/logseq/logseq/releases/download/0.10.9/Logseq-linux-x64-0.10.9.AppImage
chmod +x Logseq-linux-x64-0.10.9.AppImage
./Logseq-linux-x64-0.10.9.AppImage

# Linux via Flatpak
flatpak install flathub com.logseq.Logseq

Building from Source

git clone https://github.com/logseq/logseq.git
cd logseq
yarn install
yarn dev

Core Concepts

Block-Based Outliner

Everything in Logseq is a block. Each bullet point is an addressable block that can be referenced, embedded, or queried from anywhere in your graph.

- This is a parent block
  - This is a child block
    - Blocks can be nested indefinitely
- Use [[Page Links]] to create connections
- Use ((block-ref-id)) to reference specific blocks

Page and Block References

SyntaxDescription
[[Page Name]]Link to a page (creates it if it doesn’t exist)
((block-id))Reference a specific block
#tagTag a block (equivalent to [[tag]])
[alias]([[Page]])Display alias text linking to a page
{{embed [[Page]]}}Embed an entire page inline
{{embed ((block-id))}}Embed a specific block inline

Keyboard Shortcuts

ShortcutAction
Ctrl+KSearch pages
Ctrl+Shift+PCommand palette
TabIndent block
Shift+TabOutdent block
Ctrl+EnterToggle TODO/DONE
Alt+Up/DownMove block up/down
Ctrl+Shift+IOpen developer tools
Ctrl+C Ctrl+LCopy block reference
Ctrl+Shift+EToggle block embed
/Slash commands menu
Ctrl+UOpen graph view
Ctrl+Shift+JOpen journals

Slash Commands

CommandDescription
/todayInsert today’s date link
/tomorrowInsert tomorrow’s date link
/current timeInsert current timestamp
/calculatorOpen inline calculator
/code blockInsert a code block
/queryInsert an advanced query
/drawOpen whiteboard/drawing tool
/uploadUpload an asset
/templateInsert a template
/embedEmbed a page, block, or URL

Queries

Simple Queries

- {{query [[topic]]}}
- {{query (and [[project]] [[active]])}}
- {{query (or [[idea]] [[concept]])}}
- {{query (not [[archived]])}}
- {{query (between [[Jan 1st, 2024]] [[Dec 31st, 2024]])}}

Advanced Queries (Datalog)

#+BEGIN_QUERY
{:title "All TODO items"
 :query [:find (pull ?b [*])
         :where
         [?b :block/marker ?m]
         [(contains? #{"TODO" "DOING"} ?m)]]
 :collapsed? false}
#+END_QUERY
#+BEGIN_QUERY
{:title "Pages tagged with project"
 :query [:find (pull ?p [*])
         :where
         [?p :block/tags ?t]
         [?t :block/name "project"]]}
#+END_QUERY

Configuration

Graph Configuration (logseq/config.edn)

{;; Preferred file format
 :preferred-format :markdown

 ;; Journal settings
 :journal/page-title-format "yyyy-MM-dd"
 :default-home {:page "Contents"}

 ;; Editor settings
 :preferred-workflow :todo
 :editor/logical-outdenting? true

 ;; Feature flags
 :feature/enable-flashcards? true
 :feature/enable-whiteboards? true

 ;; Git auto-commit
 :git-auto-push true

 ;; Excluded directories
 :hidden ["/logseq" "/assets"]

 ;; Default queries on journals page
 :default-queries
 {:journals
  [{:title "NOW"
    :query [:find (pull ?h [*])
            :in $ ?start ?today
            :where
            [?h :block/marker ?marker]
            [(contains? #{"NOW" "DOING"} ?marker)]]}
   {:title "NEXT"
    :query [:find (pull ?h [*])
            :in $ ?start ?today
            :where
            [?h :block/marker ?marker]
            [(contains? #{"TODO" "LATER"} ?marker)]]}]}}

Advanced Usage

Templates

- template:: meeting-notes
  - **Date:**
  - **Attendees:**
  - **Agenda:**
    -
  - **Action Items:**
    -
  - **Notes:**
    -

Properties

- title:: My Page
  type:: [[book]]
  author:: John Doe
  rating:: 5
  status:: reading

Spaced Repetition / Flashcards

- What is the capital of France? #card
  - Paris
- Define photosynthesis #card #biology
  - The process by which plants convert light energy into chemical energy

Custom CSS (logseq/custom.css)

:root {
  --ls-font-family: "Inter", sans-serif;
  --ls-page-text-size: 16px;
  --ls-primary-background-color: #1e1e2e;
  --ls-secondary-background-color: #313244;
}

.block-content {
  line-height: 1.8;
}

Plugin Ecosystem

PluginDescription
logseq-plugin-tabsTabbed page navigation
logseq-plugin-todoEnhanced task management
logseq-plugin-gitGit integration for sync
logseq-kanbanKanban board view
logseq-citation-managerAcademic citation management

Troubleshooting

IssueSolution
Graph not syncingCheck file permissions; verify Logseq has folder access
Pages not appearing in graphEnsure pages have at least one backlink or content
Slow performance with large graphDisable unused plugins; reduce graph density
Search not finding resultsRebuild search index via Settings → General → Rebuild
Plugin not loadingCheck plugin compatibility with your Logseq version
Data corruption after sync conflictKeep a backup; use git for version control
Custom CSS not applyingRestart Logseq; check for syntax errors in custom.css