Universal alphanum identifier completion, bypassing iskeyword
Is it possible?
A completion provider that bypass iskeyword and suggests completions from universal identifiers in the buffer.
This would allow a huge gitgutter#hunk#close_hunk_previ| to be completed if close_hunk_preview_window is present in the buffer, even if iskeyword includes #.
Bonus points: work with fuzzy matching, with input like gitgutter#hunk#clhpre|
I'd like to see it ONLY (?) if there are no other completion candidates available.
Make multiple tries:
If nothing can match with alphanumeric chars only, add _ to possible chars, if no match, add -, etc..
IDEA: this could be mapped to a dedicated key (e.g. C-b ?), so I get full control on the completion sources here without adding usually-useless sources for usual auto-completion.
Impl 🤔
Can start by searching in current buffer only (or visible buffer in current tabpage)
Q: Is it worth forking the cmp-buffer for this?
If I do, I could impl this simply by forcing simple keywork pattern with - and _, and for each result split it if it contains a -, then split again if it contains a _ and include all intermediate splits in the source results..
(will need to make sure the unique comparator/sorter/whatever works well, or I'll get MANY words 👀)
ALSO: Will need to lift the strict limitation to a few results in cmp 🤔