While Sublime Text is an awesome text editor the keybindings provided are not necessarily optimal for my workflow. After years of training my muscle memories to retain the movements and behavioral shortcuts of Emacs I still want to use Sublime but keep my productivity. Therefore I wrote Sublemacs which is an Emacs mode for Sublime as Vintage is an VI mode for Sublime.

It currently supports most of the Emacs shortcuts with the visual sugar of Sublime Text. For example it supports the following additions to the standard features of Sublime:

Kill line, region ... with kill ring. All the sugar you love with a nice UI with M-w, C-w, C-y

Yank with free choice from kill ring using fancy overlay: Just press M-Y to access the kill ring and search for your last copy and pastie

Rectangular cut and insert using C-x r t and C-x r d

Named registers to store data using C-x r s [register] and C-x r i [register]

Open a new line by C+o

C+s and C+r work like expected from Emacs with repeatedly pressing C+s for navigating to the next occurrence

C+g will try to exit any kind of overlays, exit snippet mode etc

tab for reindent and M+/ for auto completion

Using named registers for storing cursor positions across multiple views

And many more, most likely a key binding that you expect from Emacs will work as well in Sublemacs. Feel fre to checkout Sublemacs eihter directly from Github or install it via Package Control.

Sublemacs supports both Sublime Text 2 and Sublime Text 3. If you have any recommendations for missing features from Emacs or request new features, feel free to drop me a line or open an issue on Github.

03/18/2013 - added key bindings for macro recording and fixed a bug for ST3 where goto open file would not work as expected

03/18/2013 - Paragraph Navigation is now available, but due to Mac compatibility bound to C-M [ and C-M ]

04/11/2013 - Added point to register and jump to point from register, search box will now disappear as soon as the focus is lost

Last edited by grundprinzip on Thu Apr 11, 2013 2:30 pm, edited 3 times in total.

Alter behavior of C-x C-f and C-x b to be a bit more like Emacs as follows (I do this on my machine)C-x C-f --- I'd prefer this to just open the dialog for the file finderC-x b --- Goto anything, which looks like a buffer list initially

Just a few things I've noticed in my short time trying it out. Some day maybe I'll have enough spare time to help out rather than just complain

thanks for your ideas. I quickly implemented zap-to-char so that it should be available right when PackageControl updates your plugin. In addition I added the key bindings for macro recording. With regards to C-x b, this is already implemented and should work now both in ST3 and ST2 (there was bug preventing it from working correctly in ST3).

If I find some time, I will look at paragraph navigation, unfortunately for C-x 0 I have to disappoint you, this simply does not work the way as it is done in Emacs, since ST works with layout groups instead of explicit windows, might be there is a more complicated way, but for now using the standard defined C-x 1, C-x 2, C-x 3 and C-x 5 2 are the way to go.

The C+s key binding has similar behavior to Emacs, but when the search panel loses focus, I would expect that typing C+s would bring it back into focus (and select the search text) so that you could choose to continue the search (C+s again) or type to replace the search text.

That's what happens both in emacs and with the normal C+f in Sublime, but not with this package. I'm liking it otherwise!

On the topic of incremental search, the behavior of repeated C-r is busted. When you hit C-r and start typing, focus goes to the first previous occurrence of the search text, as expected. But when you hit C-r again, it goes to the next occurrence! And if you hit C-s, it goes to the previous occurrence.

actually this is not Sublemacs fault, but ST's. You can validate this by opening the pristine find bar and manually clicking on the reverse button. If you then click on find it will basically find backwards, but if you click find previous it will go forward in the document. For now, I think I will make C-r open the find bar but ignore the direction so that C-r and C-s work as expected. I will post as soon as this is done.

One more suggestion, which I'm not sure is possible, but which would be swell to have:

When you use set mark (ctrl-spc) and select a region downwards, then use shift-meta-L to split into lines, the line with the mark retains its region when you move the cursor around. So if you want to, say, add a comma to every line by hitting C-e comma, the entire first line will be replaced with a comma.

Alternatively, if you set a mark and create a region upwards, split into lines, then hit C-a or C-e, the multiple selection disappears entirely and only the marked line has a cursor.

Maybe you could, I dunno, remove the mark in that case? Not entirely sure what is to be done.

One more weirdness with marks: set a mark near the end of a file, then hit alt-shift-> to go to end of buffer. Now type C-n and C-p (or up and down arrow) and note that the cursor can no longer move past the marked line.