Live Preview Code Scroll
unlistedby guoyingwei6
Keeps fenced code blocks unwrapped and horizontally scrollable as independent blocks in Live Preview.
Updated 27d ago
Live Preview Code Scroll
An Obsidian desktop plugin that keeps fenced code blocks unwrapped and horizontally scrollable in Live Preview.
Features
- No line wrapping inside fenced code blocks.
- One synchronized horizontal scroll position per code block.
- No document-wide horizontal scrolling.
- No visible per-line scrollbars.
- Each code block keeps its own content width and scroll range.
- Horizontal wheel gestures move the whole code block without first shifting only the line under the pointer.
- A per-block button beside Obsidian's copy control switches between wrapped and unwrapped content.
- Styling/transparency remains controlled by separate CSS snippets.
Reading View and Source Mode are intentionally unchanged.
Installation
- Download
main.js,manifest.json, andstyles.cssfrom the latest release. - Create
.obsidian/plugins/live-preview-code-scroll/inside your vault. - Copy the three files into that directory.
- Reload Obsidian and enable Live Preview Code Scroll under Community plugins.
Acknowledgement
The synchronized scrolling approach was inspired by Codeblock Customizer, but this plugin applies the behavior to all fenced code blocks by default and does not add unrelated styling features.
For plugin developers
Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.