Sublime Forum

EmacsKillRing for ST2

#1

Hi,

I have adapted the original EmacsKillRing plugin so that it works with ST2.

You can find my ST2 version here: github.com/stiang/EmacsKillRing.

And to the original author: Thank you! I love being able to use the kill ring again after waiting years for TextMate to support setMark.

0 Likes

#2

I don’t understand what’s the interest in this feature ?
Could you explain me with some example ?

0 Likes

#3

@stiang: no problem! glad to see it’s been updated. A very quick test has it working for me.

@oxman: emacs doesn’t use the conventional idea of copy and paste, or selecting text by using the mouse or shift-and-arrow-keys. Instead, it has an internal clipboard called the ‘kill ring’. One keypress (ctrl+k) allows you to add a line to the kill ring. So you go to the start of the text you want to cut or paste and do ctrl+k, ctrl+k, ctrl+k, ctrl+k until you’ve ‘eaten’ all the text you are interested in. Then you paste all of it. It’s just a different way of implementing cut and paste. In this plugin, instead of using an internal clipboard, we just use the OS’s clipboard.

Also, it deals with selections differently. The start of the selection is known as the mark. You move the cursor to the place you want to start selecting, then set the mark. Now you can move the cursor anywhere else in the file and hit ‘kill’. All the text between the mark and the current cursor position is sent to the clipboard. Again, it’s just a different method for implementing text selection.

The real benefit of this method is that it can be easier to make precise selections of text using only the keyboard. Setting a mark and then moving means you can make selections without having to hold down the shift key. Killing line-by-line is a nice shortcut to making a ‘proper’ selection.

0 Likes