dotfiles icon indicating copy to clipboard operation
dotfiles copied to clipboard

Universal alphanum identifier completion, bypassing iskeyword

Open bew opened this issue 4 years ago • 3 comments

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.

bew avatar May 24 '21 11:05 bew

Make multiple tries: If nothing can match with alphanumeric chars only, add _ to possible chars, if no match, add -, etc..

bew avatar Aug 31 '21 15:08 bew

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.

bew avatar Jan 27 '24 11:01 bew

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 🤔

bew avatar Sep 27 '24 20:09 bew