Sublime Forum

Emacs arg support and key bindings

#1

Has anyone implemented universal argument support, like ^U in emacs? It’s the one big thing I miss for editing with SublimeText2. Drives me bonkers not to have it. If it’s in there somewhere I must have missed it…

Also, I don’t know if anyone else likes the basic emacs command set, but if anyone is interested in that, I have a sublime-keymap file that does pretty well and I can post it somewhere.

0 Likes

#2

Unfortunately there isn’t any command for this. It would be possible to make one via the API that repeated the last command n times, but that would be back to front compared to emacs, of course.

I’m sure there would be several people interested in emacs key bindings, btw.

0 Likes

#3

Yeah ^U arg support really has to be built into the command loop. It’s not hard to do (I’ve implemented it before in C code) but is best done that way. Basically, the main command loop just has to keep track of one numeric argument and instead of executing a command, execute and decrement until the arg is zero. I’m surprised it’s not already built into ST2, because of the huge number of other features already there, most of which are far more difficult.

Anyway, the emacs-like key bindings I’m currently using are here:
azuma-asobi.com/temp/Win-Emacs-l … keymap.txt
for now… The file contains most of the basic commands and lets you move around and edit basically. I left in the bracket matching of the default file, but ripped out a load of stuff that I don’t use or don’t understand for now.

Sure would be nice to have that ^U arg support. I’d pay twice for that… :wink:

0 Likes

#4

I too would like to see ^U support.

Btw, I have put together a package to make ST2 more friendly to Emacs converts, which may be of interest to you: github.com/stiang/EmacsifySublimeText

0 Likes