I saw this blog entry this morning:
Duplicate Line/Selection in Komodo 5
Exploring the ability to create macros and bind them to key commands in Komodo IDE. I'm reposting the below macro that duplicates the lines or the current selection. Thus functionality was previously is Zend Studio 5, went missing from 6, and thanks to the macro, is available in Komodo. Enjoy!
...
I thought I should mention the Komodo bug -- Extend functionality of the "duplicate line" function -- on which Eric added a new core command to Komodo to do just this... with the added bonus that it also works for block/column selections. This was added just yesterday. Here is the checkin to Komodo Edit's repository. The nightly builds of Komodo 5.1.0a2 from last night has this in it:
Komodo IDE: http://downloads.activestate.com/Komodo/nightly/komodoide/latest-trunk/
Komodo Edit: http://downloads.activestate.com/Komodo/nightly/komodoedit/latest-trunk/
You can assign any key to this command in Komodo's "Editor | Key Bindings" preferences panel. The command name is "Editor: Duplicate Line or Selection".
5 comments
Does this do what copy/paste pair does? Would you help me see the reason for excitement about this? :) I think that developing a live browser previewer pane would be much more useful.
@roman: Yes, same as Copy/Paste. I'm not super excited about it myself, but a few people attest that it is quite useful for them. Perhaps somewhat similar: the "O" key in Vi is the same as a few different key combinations to start a new line above the current one, but I'd really miss not having it.
> I think that developing a live browser previewer pane would be much more useful.
Yes, but the little things are, of course, easier to whip together and can add up. Anyway, I just mentioned this change not because it is earth-shattering, but because it was interesting timing with the other blog post that I saw.
Duplicate Line is HUGE for me. There are just so many times when you need to duplicate a line whether it's for testing a fix ans saving the original, or doing repetitive work. Having it in a single keystroke just may pull me away from Notepad++ for good!
Thank-you!
Duplicate line is a very useful function and is beneficial alongside a copy/paste pair. It is functionality that I have missed from programmers notepad (CTRL+D).
It tends to save me several key presses and means that I need to scroll about my code a little bit less.
An example would be if you have 1 variable that appears 3 times each in 3 lines of code (the 3 lines of code are interspersed with other code you do not want to duplicate). In this instance you might do each line 1 at a time. This would mean 2 key presses for each line and 4 key presses for each lines variable. That is 18 key presses to achieve this code (I would normally use this method to make sure I did not forget to replace all the lines I had duplicated rather than duplicate the lines first and then replace the variable, if you opt for this second method it is reduced to 16).
With a duplicate key, the single variable is store in 1 key press (rather than 3) and the line are duplicated with one keypress, this reduces the keypresses to 13. What programmer is upset over a 18-27% efficiency improvement...
Also just noticed this screencast on vimeo showing how to add a macro to do this in Komodo 4. Never knew so many people wanted this. :)
http://www.vimeo.com/1237622
add a comment