Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to make Notepad++ auto-complete words on Tab instead of Enter?

Currently, if want to type, say, frame, then Enter to begin a new line, instead the Enter will select the first auto-complete suggestion, like frameElement:

    enter image description here

I do want the auto-complete feature, but I'd rather have a key like Tab do the actual selection, because Enter is frequently purposed toward starting a new line, whereas Tab is rarely used to indent after a word (since indenting is usually done at the start of lines), and so perhaps would be better repurposed toward auto-completion.

share|improve this question
up vote 1 down vote accepted

This undesired behavior is hard-coded into Scintilla, the text editing component that underlies Notepad++. It can be fixed by removing the following three lines from src/ScintillaBase.cxx:

        case SCI_NEWLINE:
            AutoCompleteCompleted(0, SC_AC_NEWLINE);
            return 0;

With this change, the Enter key no longer commits autocompletion. The Tab key already does that, as noted by user2427906.

It should be possible to download the source code for Notepad++ (which includes Scintilla), make the above change in scintilla\src\ScintillaBase.cxx (the code is slightly different in Notepad++ 6.9, but this shouldn’t be a problem), and then build Notepad++ from the modified source code.

I haven’t tried this because I don’t use Notepad++ nor Windows, but I did the same to Geany—another text editor based on Scintilla—and it seems to work.

share|improve this answer

The settings for both Tab and Enter are in the Shortcut mapper on the Settings menu. See the Scintilla Commands tab.

However, you cannot change the Tab entry to Enter as Enter is already mapped.

As intimated, this is a function of the embedded Scintilla component not the fault of Notepad++ itself.

enter image description here

enter image description here

share|improve this answer
    
What is the name of the shortcut mapping? I don't see it anywhere. – Frank Jun 13 '14 at 20:59
    
I've added appropriate screenshots – Julian Knight Jun 13 '14 at 21:07
    
Yeah, but which specific one is it? There's ~40 of them and I don't see it. – Frank Jun 13 '14 at 21:16
1  
Tab is 10 and Enter is 9 – Julian Knight Jun 13 '14 at 21:23

In the new version, there is no more appropriate to change the keyboard shortcut.
The effect of Tab is same as than Enter.

I am using notepad++ 6.7.3

share|improve this answer

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.