Dictionary Autocompletion
-
Has dictionary completion ever been discussed ? In (n)vim we can have autocompletion in scratch buffer even if we a 1MB text file containing words in in path. The text file containing words is easy to download from aspell website.
I had tried to achieve this by making the words file an XML, but the size went to 4MB and found that at startup autocompletion does not trigger. The workaround was to choose a language, trigger autocompletion in that and then choose normal mode again to have diction autocompletion. But I gave up soon as it was little annoying flow.
Would like to see your opinions folks. Thanks for reading.
Edit: adding snippet of neovim dictionary autocompletion.
-
I vaguely remember previous discussions, but didn’t feel like doing the search myself.
using
autoCompletion\normal.xml
isn’t a bad idea (and is probably the best we came up with in prior discussions). But I agree, the workaround of having to change language away from and back to Normal Text is really annoying – I created issue #12325 last fall, but nothing’s come of it yet.As a less-annoying workaround, I would suggest a macro: unfortunately, language selections aren’t macro-recordable, but fortunately, they are macro-playable. commandID 46016 sets language to Normal Text, and (at random) 46006 sets it to XML, so if you hand-craft a macro to send 46006 then 46016, it will
<Macro name="Prepare For Autocomplete" Ctrl="yes" Alt="no" Shift="yes" Key="65"> <Action type="2" message="0" wParam="46006" lParam="0" sParam="" /> <Action type="2" message="0" wParam="46016" lParam="0" sParam="" /> </Macro>
This one assigns it to Ctrl+Shift+A (for “prepare for Autocomplete”), though you can change it in the Shortcut Mapper if you want a different shortcut.
To install this macro, close all instances of Notepad++; edit
%AppData%\Notepad++\shortcuts.xml
to include that macro in its<Macros>
section and save; exit Notepad++. The next time you run, Ctrl+Shift+A will reset the language to Normal, and will then allow it to useautoComplete\normal.xml
for auto-completion right away. (Also, if you happened to have another file in your current session that has an assigned language – like if you had an XML file open – then when you File > New or File > Open a plaintext file, autocompletion will already be active.)So maybe that macro (or the trick of having another file already open) will make normal.xml work well enough for you. But maybe not.
Alternatively, you could try a feature request for the DSpellCheck plugin – which can use Aspell, Hunspell, or the Windows user dictionary: you could go to its issues page, and see if the author of that plugin would be willing to add an option to “use the active dictionary to populate Notepad++'s auto-completion word list”. (edit: it looks like someone already suggested this to the plugin author)
-
@PeterJones
I made to comment in the issue you linked that it’s actually pretty easy to implement efficient autocompletion with a large word list using the trie data structure. I made a simple proof-of-concept in PythonScript. I’m not quite satisfied with what I’ve built yet, but here’s an illustration of it doing autocompletions from the Merriam-Webster English Dictionary.
-
@Mark-Olson
I’ve now implemented case-insensitive autocompletion from a word list in the PythonScript thing:
-
@PeterJones I have no idea why I was referred as user “from the wild” in GitHub :D,
but I have settled into ALT+L to change language as of now, I didn’t know this default language change shortcut earlier, and hated using mouse. But if the issue you mentioned gets fixed in any future release it will be a great addition. -
@Debajyoti-Datta said in Dictionary Autocompletion:
I have no idea why I was referred as user “from the wild” in GitHub
The main Notepad++ developer, while he appreciates the insights of power users like me, prefers data from random users "in the wild’ (that’s normally the way I phrase that; I don’t know why I used “from” in the github issue; essentially, someone not someone like me, “on display in the zoo”, who is dealing with the esoterica of Notepad++, and trying to push it to the limits and beyond), because he feels your usage is more “typical” than someone like me or some of the other “regulars” in this forum.
Since I’ve gotten used to that perspective, even when I’m commenting in a plugin issue (which has a different developer), I tend to emphasize that whatever I’m talking about is not just from a weird power-user like me, but from a normal user “in the wild”. So even thought it was a plugin issue, not a core application issue, I pointed out that it wasn’t just me being a whiny power-user. :-)
Glad Alt+L is working for your needs for now. If you wanted to poke at issue #12325, showing that there are more people interested in the getting the normal-text-autocompletion bug fixed than just me, that might encourage Don to work on that one.
-
@PeterJones As notepad++ is not actually my primary code editor, for my needs it is almost feature complete software. I use N++ as a scratchpad, for viewing log files, to compare files and sometimes edit hex files.
If my opinion were to matter, well, I would have loved had N++ shipped with dictionary autocompletion (normal.xml or some other way), but I realise it’s not what majority of users might want. So at this point I would not poke the issue in GitHub.
-
The dictionary autocompletion thing with PythonScript has been implemented here.
-