7

Is there any way to disable enter as auto-complete key? I like autocomplete to be switched on for words, but there are times, when I need to new line while auto-complete is showing.

I'd like auto-complete to just trigger on tab for that reason. It's kinda more than average annoyance for me.

There is a similarly-looking question, but it is not similar.

4 Answers 4

6

In Settings -> Shortcut mapper -> Scintilla commands

Double click SCI_NEWLINE (should be item 9 in the list), select Enter and remove it.

------ EDIT -------

Note that you can't add Enter back after removing it in Notepad++. One way to add it back is open %appdata%\Notepad++\shortcuts.xml file, and change following lines:

<ScintillaKeys>
    <ScintKey ScintID="2329" menuCmdID="0" Ctrl="no" Alt="no" Shift="yes" Key="13" />
</ScintillaKeys>

to following:

<ScintillaKeys/>

save file and restarte NotePad++, and the setting should be restored.

4
  • 2
    Hey! I did that and now Notepad++ does not auto-indent for me. I cannot re-add the Enter shortcut so now I'm screwed X.X Please tell me what to do.
    – Foxcat385
    Nov 28, 2016 at 21:01
  • @Foxcat385 updated my answer for how to add back Enter shortcut.
    – Deqing
    Dec 6, 2016 at 0:26
  • You can't use <kbd>right</kbd> because there's a conflict, but it's a different situation; so, you should be able to use <kbd>right</kbd>. Apr 26, 2020 at 7:46
  • Where do you find the ScintIDs? Jul 24, 2020 at 18:22
3

In the current Notepad++ version (8.2.1) it is possible to set autocompletion keys easily in Settings -> Preferences dialog.

enter image description here

1

I don't know how to disable it, but a workaround would be to hit Esc before Enter to close the suggestion pop-up in that special situation where you want to insert a new line instead of auto-completing.

0

According to the related Github issue, there is nothing you can do in Notepad++ to prevent this. It would have to be changed in Scintilla itself.

I've resorted to an AutoHotkey script to replace Enter with Esc + Enter while in Notepad++:

#IfWinActive, ahk_class Notepad++
Enter::SendInput {Esc}{Enter}

This appears to work perfectly so far. Any menus/dialogs opened by Notepad++ have a different ahk_class, so this script won't send Esc+Enter when you just want to e.g. confirm a dialog with Enter.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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