I’m pleased to announce the first public version of my plugin for KDE text editors: ktexteditor-yankbuffer. It gives you emacs-like kill line (C-k) and yank (C-y) behaviour. For non-emacs users: this means that you can delete (kill) lines and then paste (yank) them in at another place in the document (or in another document). The default keybindings for kill line is Ctrl+Alt+K and for yank Ctrl+Alt+Y, but they can of course be reconfigured to suit your needs.
As an extra feature the plugin supports multiple yank buffers. By pressing Ctrl+Alt+Shift+K you create a new yank buffer (that all future kill line and yank operations will use) and then moves the current line to that buffer. If you press Ctrl+Alt+Shift+Y the current buffer is first inserted in the document, then removed and the previous buffer is made current. (The buffers are ordered as a stack with the “non-shift” operations operating on the top buffer and the “shift” operations pushing and poping a buffer on the stack.)
The kill line feature works as it does in emacs: it deletes the current line starting at the cursor and only includes the end of line (\n) if the cursor is at the end of the line. And if you kill a text segment, all lines are saved in the same buffer.
Download ktextedior-yankbuffer v0.2 and install it the usual way.
./configure --prefix=/usr make make install
If you are using debian unstable you can install the plugin by adding the following to your sources.list and apt-getting ktexteditor-yankbuffer.
deb http://eddie.ejohansson.se/debian/ sid main deb-src http://eddie.ejohansson.se/debian/ sid main
If you like to be on the bleeding edge, the source is also available from my subversion repository.
svn co http://svn.ejohansson.se/repos/src/projects/ktexteditor-yankbuffer
To end this rather long post, I’d like to give two examples on how to configure the keybindings. Me, I use these settings (C = Ctrl, S = Shift):
C-S-k: kill line to new buffer
C-y: insert kill line and pop buffer
C-S-y: insert kill line
This is what I would call an explicit push but an implicit pop.
A friend of mine instead uses these settings:
C-S-k: clear all buffers
C-y: insert kill line and pop buffer
C-S-y: insert kill line
Which would then be implicit push and pop.
If you like to see the stack depth you can turn on the Yank Buffer Toolbar in the Settings menu.
I know I said I would end this post which the examples, but I’d like to add this as well: if you have any problems, suggestions, etc. leave a comment or drop me a mail. Now, that was the last thing. I promise.


Hi,
I was trying to find a way for KDE to do control-y. And were trying your patch. But, on gentoo, he can’t seem to find KDE Headers, even though QT is ok and I do have everything on /usr/kde/ (include & lib)
the command is:
./configure –prefix=/usr
and I get this result:
checking for perl… /usr/bin/perl
checking for Qt… libraries /usr/qt/3/lib, headers /usr/qt/3/include using -mt
checking for moc… /usr/qt/3/bin/moc
checking for uic… /usr/qt/3/bin/uic
checking whether uic supports -L … yes
checking whether uic supports -nounload … yes
checking if Qt needs -ljpeg… no
checking for rpath… yes
checking for KDE… configure: error:
in the prefix, you’ve chosen, are no KDE headers installed. This will fail.
So, check this please and use another prefix!
Hope you can help me!
Sorted!
./configure –prefix=/usr/kde/3.5
Works great!
Hi! I was surfing and found your blog post… nice! I love your blog.
Cheers! Sandra. R.