Request for a couple of useful key bindings

27 views
Skip to first unread message

Ross McMillan

unread,
Oct 21, 2021, 8:45:50 PM10/21/21
to PyScripter
I'm impressed with PyScripter.  Well done.

One keyboard shortcut I would like to see is Ctrl-D to duplicate a line (or selection if there is one).  I find this soooo useful in NotePad++ and it perplexes me that Delphi doesn't do this either.

I would also like to see the same commenting key binding as in the Delphi IDE.  In Delphi, pressing Ctrl+"/" results in the line the cursor is on having the inline comment delimiter inserted at the start of that line, and (crucially!) the cursor is moved to the next line.  If the line is already commented out, the comment characters are removed.  If there is a selection, the operation is performed on the selection.

Many thanks for listening.

PyScripter

unread,
Oct 21, 2021, 8:52:23 PM10/21/21
to PyScripter
The command already exists Copy Line(s) Down.  The Current key binding is Shift+Alt+Down as in VS Code.  Works with a block of lines as well.  Also available Copy Line(s) Up, Move Line(s) Up/Down.  You can customize the key bindings to your liking via  Editor Options.

Ross McMillan

unread,
Oct 21, 2021, 10:40:03 PM10/21/21
to PyScripter
Thanks for that.  I did look to see if it already existed but I couldn't find it.  I went to Tools/Options/IDE Shortcuts and couldn't see Copy Lines Up/Down.  But on further looking around, I find Tools/Options/Editor Options/Keystrokes with a more complete list of keystrokes that includes Copy Up/Down.  Why are these options in two places?

I notice that the copy up/down functions work on entire lines.  Is there any reason why these commands couldn't respect selections that included part lines, eg.:

  This is a line with words, and more words                       
  This is a line with words, and more words, and more words                                                                   (after Shift+Alt+Down)
  This is a line with words, and more words, and more words, and more words                            (after Shift+Alt+Down)

PyScripter

unread,
Oct 21, 2021, 10:46:53 PM10/21/21
to PyScripter
The Editor Options allow customization of the editor commands and the IDE Shortcuts allow the customization of the shortcuts of the IDE commands.   There may be a consolidation at some point.

Regarding you second question:  Everything is possible but do you know any editor that does that?  

Ross McMillan

unread,
Oct 21, 2021, 11:25:21 PM10/21/21
to PyScripter
Regarding you second question:  Everything is possible but do you know any editor that does that?  

Notepad++ does this with Ctrl+D Ctrl+D duplicates the line the cursor is on if nothing is selected.  If any selection exists the selected block is duplicated, including any line breaks.  This behaviour can also be achieved with the keystrokes Ctrl-C (copy the selection to the clipboard), Ctrl+V (paste the copied text into the selection), Ctrl+V (paste the copied text again(, and again and again)).

Sublime Text works the same way.
 
On Friday, October 22, 2021 at 5:40:03 AM UTC+3 wrote:
Thanks for that.  I did look to see if it already existed but I couldn't find it.  I went to Tools/Options/IDE Shortcuts and couldn't see Copy Lines Up/Down.  But on further looking around, I find Tools/Options/Editor Options/Keystrokes with a more complete list of keystrokes that includes Copy Up/Down.  Why are these options in two places?

I notice that the copy up/down functions work on entire lines.  Is there any reason why these commands couldn't respect selections that included part lines, eg.:

  This is a line with words, and more words                       
  This is a line with words, and more words, and more words                                                                   (after Shift+Alt+Down)
  This is a line with words, and more words, and more words, and more words                            (after Shift+Alt+Down)


On Friday, October 22, 2021 at 1:52:23 PM UTC+13 PyScripter wrote:
The command already exists Copy Line(s) Down.  The Current key binding is Shift+Alt+Down as in VS Code.  Works with a block of lines as well.  Also available Copy Line(s) Up, Move Line(s) Up/Down.  You can customize the key bindings to your liking via  Editor Options.

PyScripter

unread,
Oct 21, 2021, 11:30:24 PM10/21/21
to PyScripter
VS Code and PyScripter work differently.  If there is a multi-line selection Copy Lines Down copies all selected lines (even if they are partially selected).
Reply all
Reply to author
Forward
0 new messages