Autocomplete syntax for HTML or PHP in Notepad++. Not auto-close, autocompelete

Autocomplete syntax for HTML or PHP in Notepad++. Not auto-close, autocompelete

  1. Blog
  2. 15 November 2026
  3. 3 min read

Stefan Bogdanescu

Founder & Senior Architect

Autocompletion vs. Auto-Closing in Notepad++ for HTML and PHP

When configuring a text editor like Notepad++, developers often conflate two distinct features: auto-closing tags and true autocompletion. The former simply inserts the missing closing bracket or parenthesis immediately after you type an opening one, while the latter suggests full words, functions, or attributes as you type. If your goal is to get intelligent suggestions for HTML tags or PHP functions without relying on automatic closing braces, you need to adjust specific plugin settings and understand how Notepad++ parses these languages.

Notepad++ relies primarily on its built-in Scintilla engine and optional plugins like NPP AutoCompletePlugin (often referred to as NppAutoComp) for this functionality. The default behavior of the standard HTML and PHP lexers is strictly syntax-highlighting based; they do not inherently provide a completion list. To enable autocompletion, you must explicitly install and configure the NppAutoComp plugin.

Once installed, the plugin operates by maintaining an internal dictionary or loading external dictionaries to suggest completions. However, there is a critical distinction between how it handles static HTML versus dynamic PHP. For standard HTML, the completion list consists of common tag names (e.g., div, span, input) and attribute names. You trigger this by typing a character that matches the start of a word, such as typing d to see div, or cl to suggest class. It will not automatically insert the closing </div> tag unless you have separately enabled the "Auto-Close Tags" feature in the Settings menu.

For PHP, the situation is more nuanced because Notepad++ cannot natively understand your custom logic without significant external processing. The built-in autocompletion for PHP relies on a User Dictionary or an external file containing known functions and class names. If you simply start typing echo, the plugin might suggest it if it exists in its dictionary, but it will not suggest array_map or json_encode unless those specific strings are present in the configuration.

To make this work effectively for PHP development, you typically need to point the NppAutoComp plugin to an external file containing a list of common PHP functions and classes. This is often done via the plugin's settings where you can specify a path to a .txt or .xml file listing these identifiers. Without this step, the completion engine treats every unique string as a potential new word, which results in poor suggestions for standard libraries.

A common pitfall developers encounter is expecting the editor to handle namespaces automatically. Notepad++'s autocompletion does not dynamically resolve PHP namespaces based on your use statements or require files at runtime. It relies entirely on the static text provided in the dictionary file or the user-defined list. If you are working on a Laravel project, for instance, the editor has no inherent knowledge of your installed packages unless you manually add those class names to the completion dictionary or use an IDE like PhpStorm which utilizes PHPStan or Rector for deeper analysis.

If you require robust autocompletion that understands your specific codebase—including private methods, custom classes, and database schemas—you are ultimately limited by the static nature of Notepad++. The LaravelCompany platform provides insights into how modern web frameworks structure their codebases, but relying on a simple text editor for complex PHP autocompletion often leads to friction. For those committed to Notepad++, the workflow involves maintaining an external dictionary file that mirrors your project's common usage patterns.

Ultimately, separating auto-closing from autocompletion allows you to control the granularity of your editing experience. You can have the editor suggest htmlspecialchars as you type without automatically closing the parenthesis until you press Enter or select the suggestion. This manual control reduces accidental character insertion but requires a higher level of configuration to get the suggestions right for your specific language context.

Our network