nedit-ng icon indicating copy to clipboard operation
nedit-ng copied to clipboard

How to override an existing bindkey ?

Open ericxuo opened this issue 1 month ago • 6 comments

Hi,

At work, in the legacy nedit, my bindkey Ctrl+E is used to comment the selected line(s). But in nedit-ng, Ctrl+E is mapped to "Goto Selection". Then, Ctrl+E does not do what I want. Is there a way to remove the Ctrl+E from the "Goto Selection" command ?

Regards.

Xuo.

ericxuo avatar Nov 08 '25 17:11 ericxuo

Ah good question. Right now the accelerators are hard coded but I have plans to change this to be based on a config file. So The current answer is unfortunately a source coded change which isn't ideal for you.

eteran avatar Nov 10 '25 17:11 eteran

Hello,

If you tell me which file to modify, I can try. I've asked IT people at my work to install nedit-ng. I can provide them the modified source files.

Regards.

Xuo.

ericxuo avatar Nov 10 '25 20:11 ericxuo

I think that you can get away with just editing MainWindow.ui and changing this part:

  <action name="action_Goto_Selected">
   <property name="text">
    <string>&amp;Goto Selected</string>
   </property>
   <property name="shortcut">
    <string>Ctrl+E</string>
   </property>
  </action>

And you can set the Ctrl+E to basically any other shortcut that isn't already occupied.

eteran avatar Nov 10 '25 20:11 eteran

Thank you. I'll try this.

Regards.

Xuo.

ericxuo avatar Nov 10 '25 20:11 ericxuo

Hi,

I need again your help as I don't know what to write to replace the "action_Goto_Selected" if I want to map the "Comment" action to the Ctrl+E bindkey. In other words, there is no "action_Comment_The_Line" command.

Regards.

Xuo.

ericxuo avatar Nov 14 '25 08:11 ericxuo

Oh, well if you're trying to assign a macro/shell command shortcut it'll have to be a two-step.

First you change action_Goto_Selected's shortcut to anything else (or nothing)

and then separately, you use the UI mechanisms to set the shortcut for your shell/macro command to have whatever shortcut you like.

eteran avatar Nov 14 '25 15:11 eteran