Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
counsel-at-point for generic completion at point #331
I reconstituted these snippets from your dotfiles. Are these right?
And maybe as well
Such snippets could either be added to the wiki or the readme snippet. But what would be really great would be a generic completion method, like ido-at-point, which would complete symbol at point with ivy using built-in completion system or the counsel-* completions functions if dependencies are available.
It may not require much changes to this package, since using it and re-defining this function worked for me:
Thank you for your attention and awesome completion system!
[EDIT] Oh, and no hurry of course, this is a suggestion and not a request!
* ivy.el (ivy-completion-beg): Rename from `counsel-completion-beg'. (ivy-completion-end): Rename from `counsel-completion-end'. (ivy-completion-in-region-action): Rename from `counsel--el-action'. (ivy-completion-in-region): New defun. (ivy-mode): Set `completing-read-function' to 'ivy-completion-in-region. * counsel.el: Update due to renames. Fixes #331
However, I haven't yet figured out how to hook e.g.
Oh, that is great news, thank you!
I do not know how jedi is usually integrated with complenion systems.
Both seems to use jedi-core as a basis.
Maybe you have seen all of this already.
@abo-abo for me very useful something like this:
(defun counsel-company () "Complete using `company-candidates'." (interactive) (unless company-candidates (company-complete)) (when company-point (company-complete-common) (when (looking-back company-common (line-beginning-position)) (setq ivy-completion-beg (match-beginning 0)) (setq ivy-completion-end (match-end 0))) (ivy-read "company cand: " (mapcar (lambda (x) (concat x "\t\t" (company-call-backend 'annotation x))) company-candidates) :action (lambda (x) (ivy-completion-in-region-action (replace-regexp-in-string "\t\t\.*" "" x)) (run-at-time 0.01 nil 'company-pseudo-tooltip-hide)))))
But I think that annotation should have another face. May be need some defcustom for customize that.
I think adding annotations (with correct face) must be done by transformer, but my transformer does not work for now:
(defun counsel-company-transformer (str) "Add highlighted annotation into STR." (let ((annotation (company-call-backend 'annotation str)) (set-text-properties 1 (length annotation) '(face success) annotation) (concat str "\t\t" annotation)))) (ivy-set-display-transformer 'counsel-company 'counsel-company-transformer)