This plugin can keep a custom distance before and after cursor, just like scrolloff
in vim of cursor surrounding lines
in VS-Code.
- Define a distance you like in setting tab.
- Enjoy it!
You can set the distance to either a fixed distance with unit in px
or a relative distance to the height of the content area.
This plugin will exam the boundary situation. If the given distance more than half of the content area, it will be regarded as half of the content (actually less then half, beacause of the height of cursor).
- Copy over
main.js
,styles.css
,manifest.json
to your vaultVaultFolder/.obsidian/plugins/obsidian-scroll-offset/
.