Code Blocks
Syntax-highlighted code blocks with advanced features
Code blocks let you include formatted code snippets in your notes with syntax highlighting. Octarine supports over 300 programming languages and provides helpful editing features to make working with code easier.
Creating a Code Block
There are several ways to insert a code block:
- Type
/and select "Code Block" from the menu - Use the markdown syntax: type three backticks
```, press Enter, then close with three more backticks - Use the keyboard shortcut:
Cmd/Ctrl + Option/Alt + C
Selecting a Language
After creating a code block, click the language selector at the top-left corner to choose from over 300+ supported languages. The selector is searchable, so you can quickly find the language you need.
Once you select a language, syntax highlighting is applied automatically to make your code more readable.
Editing Code
Code blocks support helpful editing features:
- Tab/Shift+Tab — Indent and outdent lines of code
- Copy button — Click the copy icon to copy the entire code block to your clipboard
Formatting
Unlike the rest of your note, code blocks preserve:
- Exact spacing and indentation
- Multiple consecutive spaces
- Line breaks exactly as typed
This ensures your code appears exactly as you write it, without any automatic formatting changes.