Implement Ctrl/Cmd + up/down arrow key to scroll the viewport without moving cursor

As the title. Nothing more to it.

Convenient to not have to take your hands off kb and reach for the mouse wheel.


This was moved from Feature requests to Plugin ideas.
(I cannot edit the original post. Disabling editing is perplexing.)

IMO this should be a basic feature, but whatever. I’m assuming the thread being moved means you can make a plugin to do it.

Okay then.

I moved it to plugin ideas. The current behavior Ctrl up/down is pretty standard among text editors and we do not intend to change it.

Somebody can write a plugin for this.

Where it does nothing?

That’s not been my experience. I use 2 editors daily - vscode and sublime text. Both feature this behavior by default.

But I suppose google docs (maybe word) and notepad don’t.

Somebody can write a plugin for this.

Me. That would be me.
Now I just gotta figure out how to publish it.

1 Like

ok, I double checked this. I think I misread your FR initially. It’s possible that a plugin that does this already exists. Anyway I moved this back to FR and renamed it.

I was not able to find such a plugin. (Searching “scroll” through the plugins listing.)

I have already written the code.

If it exists it would save me the trouble of finding a way to publish it. If you are also unable to find such a plugin, I will look into the procedure for publishing it.

One problem with it, is that it scrolls a set amount, while lines can be variable height. The benefit is that it’s dead simple and I went from not knowing how to write a plugin to finished in 1 hour.

But it is default behavior in other power-user editors like vscode and sublime so perhaps it’s a good idea to have a better, native implementation.

(I guess you can’t edit posts in this forum section? Edit: Or edit privileges expire in a short time. :grin:)

P.S. Behavior differences! The cursor is sticky in sublime - it will not move out of the viewport when scrolling. vscode is happy to leave it alone.

At least on Mac the standard behavior is to move the cursor, so I wouldn’t want that to change in Obsidian (in a plugin I have no opinion, of course).

  • Command–Up Arrow: Move the insertion point to the beginning of the document.
  • Command–Down Arrow: Move the insertion point to the end of the document.

— Mac keyboard shortcuts - Apple Support

1 Like

Hi martixy could you please post the code you used to do this - I agree it’s a very useful feature. (It’s also standard behavior in Notepad++)

Thank you.

1 Like

I would also like the feature suggested here as it is pretty much standard behavior (so I was dismayed by the unwarranted claim that it’s not). I have used it in IntelliJ (and all similar IntelliJ products), VS Code, Visual Studio, SQL Server Studio, and Sublime Text.

In the mean while, there’s a plugin named “Typewriter Scroll” which makes things slightly better, as it always scrolls to keep the cursor in the middle of the screen. Unfortunately it doesn’t scroll the file title into view when you go to the top of the document.

1 Like