Sublime Forum

Ctrl-D, Ctrl-U in Vintage Mode

#1

I’m a newcomer to Sublime, so please forgive me if this is an obvious one.

I was expecting Ctrl-D to scroll a half-page down, and Ctrl-U to scroll a half-page up in Vintage mode. It looks like Ctrl-D is an emacs-like delete-after-cursor binding, and Ctrl-U doesn’t do anything (AFAICT). Is there a way to bind these keys to do this according to my expectation, or is this planned for Vintage?

Thanks!

0 Likes

#2

I don’t think it would be hard to implement them. Ctrl+F and Ctrl+B are already there. However, Ctrl+D would clash with additive selection, which is a very handy feature of ST. Ctrl+U is also bound to soft_undo.

But it seems that the move command is implemented entirely in the core, so a “half_page” parameter would be required if it doesn’t exist yet… As far as I can tell, I can’t be done in Python, unfortunately.

0 Likes

#3

Ah, thank you. I can relearn a motor memory muscle or two.

When I use Ctrl+D, it deletes a character. Maybe this is a windows binding that you speak of? I’m still getting used to the bindings on the Mac, so I don’t know how other systems are bound.

0 Likes

#4

All right, it’s “super+d” for OSX. Differing key bindings across platform are a nightmare to communicate…

Btw, H,L,M are functional too, even if not fully faithful to vi yet.

0 Likes

#5

In your Default (OSX).sublime-keymap file, you can add the following to emulate and from vim:

{"keys": "ctrl+u"], "command": "scroll_lines", "args": {"amount": 40.0}, "context": { "key": "setting.command_mode" }]}, {"keys": "ctrl+d"], "command": "scroll_lines", "args": {"amount": -40.0}, "context": {"key": "setting.command_mode"}]}
Hope that helps

1 Like

#6

Sorry to revive this thread for my personal issues here but Im running build 3064, placed the definitions in the keymap file and only have a functional ctrl+u. Ctrl+d doesnt work… not sure what im doing wrong. I searched the default keymap file for other conflicting definitions but to no avail. I made sure to check syntax for the entries and can’t seem to find any issues. Anyone have an idea?

By the way, thanks for the solution to begin with! This is a huge part of my vi-mode process.

0 Likes

#7

Apologies about reviving this old thread, however, wanted to help anyone else that may come by this.

Adapting the answer by @the0ry to ST3, and changing the amount to half a page would be:

{“keys”: [“ctrl+u”], “command”: “scroll_lines”, “args”: {“amount”: 20.0}, “context”: [{ “key”: “setting.command_mode” }]},
{“keys”: [“ctrl+d”], “command”: “scroll_lines”, “args”: {“amount”: -20.0}, “context”: [{“key”: “setting.command_mode”}]}

0 Likes