Skip to content

Obsidian

  • To open the current note in your external editor (e.g. VSCode), ⌘P → “Open in default app”
  • You can surround text with quotes and/or backticks by highlighting it and typing the quote
  • ⌘X: cut (works when you have no selection just like VSCode)
  • Mobile shortcuts:
    • Swipe right: search
    • Swipe left: view outline
    • Swipe down: command palette
  • Installing on Chromebook: just download the .deb file from here (click “more platforms” to find it rather than using the AppImage) and double-click it. If you already had it installed, then it’ll update without you having to pin a new app to your taskbar.
  • Aligning code blocks in a list: just tab the whole block to the level of the previous list item (reference)
  • To copy formatted lists to Google Docs, switch into Reading Mode (⌘E) and then copy the list from Obsidian
  • To resize images (reference), do something like this: ![[Pasted image 20240128152122.png|500]], where 500 is the width
  • To link to a heading/header in a note, do this:

I haven’t figured out password-protection, so I’m actually still using OneNote for that. The best I’ve done is separate my notes directly on my filesystem:

  • Obsidian Vaults
    • public
    • private

Then, when opening the root folder (Obsidian Vaults), I changed the CSS to make it look like this: Pasted image 20240128152122.png Doing that was as simple as creating Obsidian Vaults/.obsidian/snippets/snippet.css:

body {
--titlebar-background: darkred;
--titlebar-background-focused: red;
--background-primary: #301515;
--background-secondary: hsl(0 78% 8%);
}

This was a beast. Props to Jumumu for writing these instructions (based on this repo—MAKE SURE TO GET THE REQUIREMENTS FROM THAT REPO!). Here was the final configuration that I used:

Terminal window
$dryRun = 0
$notesdestpath = '.\output'
$targetNotebook = ""
$usedocx = 1
$keepdocx = 2
$docxNamingConvention = 1
$prefixFolders = 1
$mdFileNameAndFolderNameMaxLength = 255
$medialocation = 2
$conversion = 'gfm+pipe_tables-raw_html'
$wrapCodeBlocks = 1
$headerEnabled = 1
$headerTimestampEnabled = 1
$keepspaces = 1
$keepescape = 3
$newlineCharacter = 1
$exportPdf = 1

…but remember to run all of the other formatting steps afterward (namely the sed commands). Note that I only ran Prettier a single time because it started doing some weird things after that.

Some notes about the migration:

  • Other formatting steps
    • Attachments are exported to a “media” folder by default. I moved all of these to “attachments” with find . -type d -name "media" -execdir mv {} attachments \; and then used VSCode to find/replace all ![](media/ with ![](attachments/. Note that it’s still a good idea to search for media/ to make sure you found all occurrences since some had angle brackets around them.
  • Some attachments came out as 0-byte images, presumably because OneNote hadn’t finished syncing before I’d started the export process.
  • ”Folder notes”…
    • What are they:
      • Pasted image 20231231190407.png
      • Notes that have contents (my game ideas) and other notes beneath it.
    • What happens to them:
      • They get converted to Obsidian like this:
        • Pasted image 20231231190521.png
        • …where “Game-ideas” shows up both as a folder and a file within that folder.
  • I used this script from Jumumu to fix file names containing too many hyphens (delete the comments on the mv lines to get it to run; the script doesn’t do a “proper” dry run since pass 3 depends on pass 1 completing):
    #!/bin/bash -e
    echo -e "Pass 1 - Replacing '---' with '←'\n"
    find . -depth -name "*---*" -not -name "*.png" -print0 | while IFS= read -r -d '' file; do
    newname="$(dirname "$file")/$(basename "${file//---/←}")"
    echo "Renaming $file to $newname"
    # mv "$file" "$newname"
    done
    echo -e "\nPass 2 - Replacing '-' with ' '\n"
    find . -depth -name "*-*" -not -name "*.png" -print0 | while IFS= read -r -d '' file; do
    newname="$(dirname "$file")/$(basename "${file//-/ }")"
    echo "Renaming $file to $newname"
    # mv "$file" "$newname"
    done
    echo -e "\nPass 3 - Replacing '←' with '-'\n"
    find . -depth -name "*←*" -not -name "*.png" -print0 | while IFS= read -r -d '' file; do
    newname="$(dirname "$file")/$(basename "${file/// - }")"
    echo "Renaming $file to $newname"
    # mv "$file" "$newname"
    done

My setup uses the official apps and then Syncthing for syncing.

Syncthing is what handles conflicts. It does so by creating a conflict file with the same extension as the original. This can happen when there are concurrent edits or at least concurrent synchronizations (e.g. both devices were lacking internet and came online at the same time).

  • Detecting conflicts: you’ll see a file like “Obsidian.sync-conflict-20231220-113254-ZZR3M5U.md” in the folder that you’re syncing, which Obsidian will then pick up and display alongside the original note.
  • Recovering from conflicts: you can just diff in a program like VSCode. Alternatively, check out these plugins:

Just update the app. This only happened to me on my Chromebook.