v7.6.3 auto completion *.cpp Not Working
Many words Not Working ，for example “accumulate,define,pragma”
keywords with a
#prefix will not autocomplete automatically.
if you want them to autocomplete after typing the prefix
#you will have to add them without prefix to your cpp.xml.
cpp.xml is usually located at:
%ProgramFiles(x86)%\Notepad++\autoCompletion\cpp.xmlfor notepad++ x86,
%ProgramFiles%\Notepad++\autoCompletion\cpp.xmlfor notepad++ x64,
npp.7.6.3.bin[.x64]\autoCompletion\cpp.xmlfor portable versions.
edit your cpp.xml and insert the following between
<KeyWord name="#undef" />and
<KeyWord name="abort" func="yes">:
<KeyWord name="define" /> <KeyWord name="elif" /> <KeyWord name="else" /> <KeyWord name="endif" /> <KeyWord name="error" /> <KeyWord name="if" /> <KeyWord name="ifdef" /> <KeyWord name="ifndef" /> <KeyWord name="include" /> <KeyWord name="line" /> <KeyWord name="pragma" /> <KeyWord name="undef" />
note: keys like
accumulateshould auto complete correctly on 7.6.3, if you have auto completion enabled.
if not, here’s the current >>> cpp.xml <<< for you to use and/or compare.
also make sure your cpp.xml is not in a folder called
plugins/APIs, as this would be a wrong location, and only a left-over folder from an older notepad++ installation on your machine.
My cpp.xml is the same as yours. It should not be #prefix proleme.
if your cpp.xml is the same as mine, and you have added the lines as described above, your auto completion will work correctly, as seen at the screenshots below.
if not, please re-check all instructions from above.
An other possibility which does not need any change in auto-completion files, is to modify the following N++ setting :
Settings > Preferences... > Delimiters > Add your character as part of wordin the Word character list zone
Just insert a
#character in the fied
From now on, the
#character is seen as a word character when double-clicking for selection and also, when searching in
Normalmode search, with the option
Match whole word onlyset !
Just play around with that text, below, double clicking and searching, in Normal mode, with the
Match whole word onlychecked or unchecked
1 word #word word 5 word word# word 9 word wo#rd word 2 word#word word 6 wordword# word 10 wordwo#rd word 3 word #wordword 7 word word#word 11 word wo#rdword 4 word#wordword 8 wordword#word 12 wordwo#rdword
Note that, in that case, when using the
Regular expressionsearch mode, this added
#character is still not considered as a word character (
\w) and only as a NON-word character (
\W) or as a punctuation character (
your recommendation is the best way, as adding # as part of word, will also trigger auto completion immediately, as soon as a # is typed. 👍