Attached is a bundle to implement kill (^k) and yank (^y) as close to the Cocoa/Emacs implementation as I've been able to get. I hope others can get some use out of it as well.
Using TextMate, I've had a terrible time trying to overcome years of muscle memory in using ^k to kill and ^y to yank. The same functionality is certainly available in TextMate, but I just can't make my fingers not expect ^k and ^y to work a certain way. Allan has mentioned that a Cocoa-like kill buffer is on his todo list, but I thought I'd attempt something to tide myself over until that arrives.
Some high-level things you should know about the bundle:
* It does map ^k and ^y.
* Like Cocoa/Emacs it uses a kill buffer totally separate from the standard Cocoa clipboard.
* I couldn't figure a good way to implement the kill buffer without using the filesystem, so that's what it does.
* In order to get the behavior as close as possible to a real Cocoa kill buffer, it's a great kluge of multiple commands and macros. That fact plus the fact that it uses the file system makes it sort of slow (I think certainly usable, though).
I hope folks find some use in it.
thanks , this is something I've been missing a lot too
can i ask : what does ^k normally do in TM - just consign the text to oblivion? I'd be moderately happy with the default arrangement if it just went in the normal clipboard ...
D
On 26/03/2005, at 6:56 AM, Chris Brierley wrote:
<kill_buffer_1.0.zip>
On 26.03.2005, at 01:17, David Lee wrote:
can i ask : what does ^k normally do in TM - just consign the text to oblivion? I'd be moderately happy with the default arrangement if it just went in the normal clipboard ...
me, too. however, that sounds, like a macro should be able to do that, because it's essentially just two steps:
- select from cursor to line end - cut
hth,
t.
-- tom lazar tom@tomster.org http://tomster.org
On Sat, 26 Mar 2005 14:32:08 +0100, Tom Lazar tom@tomster.org wrote:
however, that sounds, like a macro should be able to do that, because it's essentially just two steps: select from cursor to line end, cut
If that satisfies you, it's certainly a *much* simpler way of doing it.
The problem, at least for me, is that it's not how "real" ^k works. It has pretty specific behavior:
* It kills form the point to the end of the line, not consuming the newline. * UNLESS it's at the beginning of a blank line in which case it *does* consume the newline. * It appends consecutive kills to a buffer which can then all be yanked out at once with one key combo: ^y. * It uses, purposely, a separate kill buffer from the clipboard.
In order to get all of that functionality, which is what I'm used to, I had to do a bunch of crazy stuff with commands, tmp files, and macros.
So, this bundle is probably only for people who are really used to the standard ^k/^y behavior and haven't been able to train themselves to do it another way with TextMate.
My attitude is: I dig the emacs way of doing many things, and this is something I'd like on some level to see reimplemented .. but reimplementing emacs is a big job on top of writing a decent editor ;)
I'm pretty impressed that we have a text editor on our hands where 'simple things are easy and difficult things are possible' with regard to our customizations.
Let's see how Allen goes with kill ring implementation; i could understand him considering things people can do themselves with the macro language provided to be lower priority than things they can't
In the meantime I'll try out that bundle of yours if i get frustrated ;)
cheers D
On 27/03/2005, at 4:46 AM, Chris Brierley wrote:
On Sat, 26 Mar 2005 14:32:08 +0100, Tom Lazar tom@tomster.org wrote:
however, that sounds, like a macro should be able to do that, because it's essentially just two steps: select from cursor to line end, cut
If that satisfies you, it's certainly a *much* simpler way of doing it.
The problem, at least for me, is that it's not how "real" ^k works. It has pretty specific behavior:
- It kills form the point to the end of the line, not consuming the
newline.
- UNLESS it's at the beginning of a blank line in which case it *does*
consume the newline.
- It appends consecutive kills to a buffer which can then all be
yanked out at once with one key combo: ^y.
- It uses, purposely, a separate kill buffer from the clipboard.
In order to get all of that functionality, which is what I'm used to, I had to do a bunch of crazy stuff with commands, tmp files, and macros.
So, this bundle is probably only for people who are really used to the standard ^k/^y behavior and haven't been able to train themselves to do it another way with TextMate. ______________________________________________________________________ For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
yeah, realised (and implemented in 30 secs) just after i posted.
D
On 27/03/2005, at 12:32 AM, Tom Lazar wrote:
On 26.03.2005, at 01:17, David Lee wrote:
can i ask : what does ^k normally do in TM - just consign the text to oblivion? I'd be moderately happy with the default arrangement if it just went in the normal clipboard ...
me, too. however, that sounds, like a macro should be able to do that, because it's essentially just two steps:
- select from cursor to line end
- cut
hth,
t.
-- tom lazar tom@tomster.org http://tomster.org
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate