Copy and Past Code lazarus / 13-General ---------------------------------------------------------------------- yinhuajian · 2026-01-06 07:29 In Visual Studio, when no code is selected, pressing Ctrl + C copies the entire line where the cursor is located. Immediately pressing Ctrl + V then inserts a new line and pastes the copied code.  Does Lazarus have a similar feature? ---------------------------------------------------------------------- Thaddy · 2026-01-06 08:15 Yes, but you have to select the line(s). Lazarus behaves similar: ctrl-c, ctrl-v, ctrl-z amongst others. (Basically Wordstar) ---------------------------------------------------------------------- fred · 2026-01-06 09:23 I asked lumo AI "write a lazarus editor macro to duplicate a line" and it gave the code and instructions to add it to the IDE. ---------------------------------------------------------------------- Martin_fr · 2026-01-06 09:48 Lazarus has a duplicate line command: Ctrl-Shift-Alt-Insert If a selection exists, it acts on the selected lines (including the non selected part of each partly selected line). There is another command (you can edit keys for it) that will duplicate the selection (without any extension). There are also commands to move the current/selected lines up/down. Or move the selected text in any direction. And there are commands to cut/copy the current line to clipboard. (By default, if nothing is selected, the IDE either does not copy, or does copy the "word at caret" to clipboard). Copy/Cut can also append to existing clipboard. ---------------------------------------------------------------------- Martin_fr · 2026-01-06 09:55 If you want an exact replica of what you described you can write yourself an editor macro. https://wiki.freepascal.org/IDE_Window:_Editor_Macros They support Pascal script. So you can check if anything is selected or not, and then copy accordingly. You can then assign such a macro to ctrl-C ---------------------------------------------------------------------- n7800 · 2026-01-15 18:47 For reference, you can find the above features in "IDE Options > Editor > Key Mapping". There's also an option: "IDE Options > Editor > General > Miscellaneous > Copy current word when no selection exists" Personally, I don't enable it because I'm afraid of accidentally overwriting the buffer when I miss [Ctrl+V] ))