如何在记事本 + + 中启用自动完成支持?

我试图添加一个简单的语法突显和自动完成一个简单的脚本语言..。

我使用 这篇文章添加了语法突显

现在我想知道如何使用 Notepad + + 为我的自定义语言启用自动完成。有人知道怎么做吗?

212166 次浏览

For basic autocompletion, have a look at the files in %ProgramFiles%\Notepad++\plugins\APIs. It's basically just an XML file with keywords in. If you want calltips ("function parameters hint"), check out these instructions.

I've never found any more documentation, but cpp.xml has a calltip for fopen, while php.xml is quite complete.

The link provided by Mark no longer works, but you can go to:

Notpad++ 6.6.9

  • Settings -> Preferences -> Auto-Completion -> Enable auto-completion on each input.

I find it very annoying though, since a big autocomplete block is always coming up and I would just like to see autocomplete when I press tab or a key combination. I am fairly new to Notepad++ though. If you know of such a key combination, please feel free to reply. I found this question via Google, so we can always help others.enter image description here

Go to

Settings -> Preferences -> Backup/Autocompletion

  • Check Enable auto-completion on each input. By default the radio button for Function completion gets checked, that will complete related function name as you type. But when you are editing something other than code, you can check for Word completion.

  • Check Function parameters hint on input, if you find it difficult to remember function parameters and their ordering.

Don't forget to add your libraries & check your versions. Good information is in Using Notepad Plus Plus as a script editor.

Autocomplete in Notepad++ is as simple as hitting Ctrl + Enter or Ctrl + Space in the interface.

Ctrl + Enter - as simple as that!

This, for many people, will be better than autocompleting on everything.

You can also add your own suggestion.

Open this path:

C:\Program Files\Notepad++\plugins\APIs

And open the XML file of the language, such as php.xml. Here suppose, you would like to add addcslashes, so just add this XML code.

<KeyWord name="addcslashes" func="yes">
<Overload retVal="void">
<Param name="void"/>
</Overload>
</KeyWord>

It is very easy:

  1. Find the XML file with unity keywords
  2. Copy only lines with "< KeyWord name="......" / > "
  3. Go to C:\Program Files\Notepad++\plugins\APIs and find cs.xml for example
  4. Paste what you copied in 1., but be careful: Don't delete any line of it cs.xml
  5. Save the file and enjoy autocompleting :)

Open Notepad++ and Settings -> Preferences -> Auto-Completion -> Check the Auto-insert options you want. this link will help alot: http://docs.notepad-plus-plus.org/index.php/Auto_Completion