Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Specifically I want to make a context menu option that (on rightclick) removes/deletes the current line. The catch is the line should be deleted even if it´s not selected. Meaning I don't have to use CTRL+SHIFT+UP & CTRL+SHIFT+LEFT or mouse to select the line before deleting. The only required thing would be just a click on the line making it selected.
I also need a string for shortcuts.xml file so this would show up under the Run menu. I can edit contextmenu.xml myself because that's the easy part.

Is it possible?
I looked at various N++ commands and there were some Scintilla commands that looked like what I needed but I had no luck putting them into shortcuts.xml so they would work.

share|improve this question

1 Answer 1

up vote 6 down vote accepted

I also need a string for shortcuts.xml file so this would show up under the Run menu.

This part cannot be done. The Run menu only contains external commands.

Specifically i want to make a context menu option that (on rightclick) removes/deletes the current line.

This can be easily done using a macro:

  1. Click Macro -> Start Recording.

  2. Mimic deleting the current line by pressing the following keys:

    Home, Home, Shift + End, Del, Del

    (The second Home is to remove possible indentation.)

  3. Click Macro -> Stop Recording.

  4. Click Macro -> Save Current Recorded Macro....

  5. Choose a macro_name (mandatory) and a key combination (optional).

  6. Click OK.

  7. Edit the contextMenu.xml and add the following line:

    <Item MenuEntryName="Macro" MenuItemName="macro_name"/>
    
  8. Restart Notepad++.

share|improve this answer
2  
Here's an upvote++ for your great Notepad++ answers. :) –  iglvzx May 15 '12 at 3:11
    
Dig in deep of N++..... ++1 :) –  avirk May 15 '12 at 3:37
    
Thanks. I guess this is the best way to do it. –  TMRW May 21 '12 at 19:27
    
if you have time check out my other topic. It's very similar: superuser.com/questions/424562/… –  TMRW May 21 '12 at 19:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.