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.

4 Likes

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.
brb

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

@Eloq @tias
Late reply, but better than never, right?

IIRC, I actually published the plugin in the community repository. Then they saw fit to delete my account, I think? I couldn’t log in with my old credentials and Forgot password did nothing. Lol. (Does obsidian purge inactive accounts? I hadn’t logged in in a long time. Ah, whatever. ¯\_(ツ)_/¯ )

Now… you wanted the code. I will give you that. But I make absolutely no guarantees it still works. This was written months ago for a prior version and I am not currently using obsidian.

Have at thee:

I believe the only account needed to publish a plugin in the community store is a GitHub account. The team occasionally removes plugins from the community store that appear to be unmaintained (have been broken for a long time and the maintainer doesn’t respond to communications), but it doesn’t look like enough time has passed for that to happen. Did your plugin definitely make it thru the whole publishing process?

I may be misremembering as well. It matters not.

Loading an unpublished plugin is rather simple either way.

Hey, I think this plugin is essential, but I’m not a tech savvy. I downloaded the repository and saved it in the Obsidian plugin folder. I noticed that the file main.ts is in other plugins main.js, so I simply changed the format. This didn’t work, though, so I must be doing something wrong. Also, other repositories for external Obsidian plugins come with “Releases”, and installing it from there seems easier. I’d be glad to receive dumbed down instructions. (EDIT: the plugin might not work because it hasn’t been updated for months)

I eventually find a way using node.js and somehow managed to make it work. I just want to mention that this plugin has potential to be improved by enabling smooth scrolling and hotkey customization. So perhaps one day someone will plunge into it.