Skip to content

Instantly share code, notes, and snippets.

@jmc734
Last active May 14, 2016 11:55
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmc734/157ff4a4ee85f8e58102 to your computer and use it in GitHub Desktop.
Save jmc734/157ff4a4ee85f8e58102 to your computer and use it in GitHub Desktop.

Improving PHP Auto-Complete in Notepad++

Currently, whenever you type "<?php" at the top of a new PHP file, Notepad++ comes back with the following recommendations:

  • php_egg_logo_guid
  • php_ini_loaded_file
  • php_ini_scanned_files
  • php_logo_guid
  • php_real_logo_guid
  • php_sapi_name
  • php_strip_whitespace
  • php_uname
  • phpcredits
  • phpinfo
  • phpversion

None of which are what you actually want and if you click return after the second "p", Notepad++ complete it to the first recommendation, "php_egg_logo_guid".

php_egg_logo_guid is an easter egg function in PHP that's similar to php_logo_guid though like php_logo_guid it was removed as of version 5.5.0.

What this patch file does is adds a new entry to the auto-complete dictionary with the string "php", which will be the new top recommendation for the entered string "<?php". That way it will still be auto-completed but to the correct string. That's better.

Usage

  1. Locate the PHP auto-complete dictionary file included with Notepad++ called php.xml, typically located at %ProgramFiles(x86)%\Notepad++\plugins\APIs\php.xml.
  2. Apply the patch to that file using a patch(1)-compatible utility.
--- php.original.xml 2014-12-06 16:28:15.000000000 -0500
+++ php.xml 2014-12-06 16:27:42.000000000 -0500
@@ -10331,6 +10331,7 @@
<Param name="[int options=PGSQL_DML_EXEC]"/>
</Overload>
</KeyWord>
+ <KeyWord name="php" func="no"/>
<KeyWord name="pg_version" func="yes">
<Overload retVal="array">
<Param name="[resource connection]"/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment