• wincent's avatar
    Add .ycm_extra_conf.py for article and post autocompletion · 5ba4976f
    wincent authored
    I've hacked together a custom YouCompleteMe completer that will allow me to
    autocomplete wiki and blog post links in Markdown files. It connects to my local
    Redis index to get the list of articles and posts, so some configuration is
    needed and I didn't want to back that into the completer plugin itself.
    
    Additionally, I don't want this to apply to all Markdown files everywhere, just
    the ones in this repo, so the hacky way I'm making that happen is by
    "configuring" only this repo with the metadata for the completion.
    
    Any Markdown file outside this repo won't have this kind of module as an
    ancestor, and even if it did, it wouldn't set the pertinent variables
    (`markdown_prefix` and `markdown_cache_breaker`). I try to handle that scenario
    gracefully, but I have `try`/`except` in the completer in case I screw things
    up. In any case YouCompleteMe seems to handle exceptions in the completer
    backends pretty gracefully, falling back to identifier completion.
    
    As far as I can tell, what I am doing here and in the completer is utterly
    heinous, but it works and is too useful to not have.
    5ba4976f
.ycm_extra_conf.py 363 Bytes