Skip to content

omeyenburg/obsidian-scrolling

Repository files navigation

Scrolling

A plugin for Obsidian to keep the cursor centered, disable code wrapping, enable image zooming & much more.


Features

Each feature is fully optional and can be toggled or configured in the plugin settings.

Centered cursor

  • By default, Obsidian only scrolls when the cursor reaches the edge of the viewport.

  • This feature automatically scrolls the view to keep the text cursor near the center while editing or navigating.
    (Also known as 'typewriter mode' or similar to 'scrolloff' in Vim)

    Centered cursor preview

Horizontal scrolling

Code blocks
  • Disable wrapping and enable horizontal scrolling in code blocks.

    Code blocks preview
Inline MathJax
  • Make inline MathJax scrollable and prevent it from extending the viewport.

    MathJax preview
File tree
  • Allow horizontal scrolling in the file tree.

    Filetree preview

Remember scroll position

  • By default, Obsidian will always open files and place you at the top.

  • This feature saves your scroll position when closing a file and restores it when reopening the file later.

    Restore scroll preview

Scroll to zoom images

  • Zoom into an image based on your mouse pointer position.

  • Hover over an image and scroll while holding the ctrl key.

    Image zoom preview

Scrollbar customization

  • Customize when the scrollbar is shown or hidden.

Line length

  • Set the maximum line length as pixels, characters or percentage.

  • Toggle readable line length with a command or keybind.

    Line length preview

Reading mode keybinds

  • Use Vim-like keybinds to scroll in reading mode:
    down (j), up (k), half-page down (d), half-page up (u), bottom (G), top (g)

Mouse & touchpad scrolling (Desktop only)

  • Change the speed and smoothness of scrolling with mouse and touchpad.

Installation

  1. In Obsidian, open Settings → Community Plugins.
  2. Make sure Safe Mode is turned off to enable plugin installation.
  3. Click Browse, then search for "Scrolling" or open directly:
    obsidian://show-plugin?id=scrolling
  4. Click Install, then Enable the plugin.
  5. You can configure this plugin under Settings → Community Plugins → Scrolling.

Manual installation

  1. Open your vault in your terminal and navigate into .obsidian/plugins.
  2. Clone the repo:
    git clone https://github.com/omeyenburg/obsidian-scrolling.git
  3. Build the plugin:
    cd obsidian-scrolling
    npm install
    npm run build
  4. Enable the plugin under Community Plugins.

Requirements

  • Obsidian: Version 1.2.7 or higher
  • Platform: Desktop only

Changelog

See Releases for version history.

Contributing

Contributions are welcome! Feel free to open an issue or submit a pull request.

To start developing:

  1. Follow the Manual installation steps.
  2. Run the plugin in development mode, which will automatically rebuild the plugin on file changes:
    npm run dev

Similar projects

License

MIT License. See LICENSE for details.

About

Obsidian plugin to keep your cursor centered, disable code wrapping, remember position in a file, and more.

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •