Description
*Sorry for don't know how to post an issue correctly and my poor English,
If there are somewhere goes wrong /can do better, please give me a chance to apologize and fix it next time
I would like to integrate yasnippet's suggestions into company's pop suggestion menu every where.
I use Irony-mode and company-Irony company-irony-c-headers
way1.from the only answer of a question on stack exchange
http://emacs.stackexchange.com/questions/10431/get-company-to-show-suggestions-for-yasnippet-names
---->don't work
way2.from https://gist.github.com/nonsequitur/265010
---->don't work
way3.from http://stackoverflow.com/questions/2087225/about-the-fix-for-the-interference-between-company-mode-and-yasnippet
----->don't work
finally, I use
(eval-after-load 'company
'(add-to-list
'company-backends '( company-irony-c-headers company-irony company-yasnippet)))
and sucessfully realize both company and yasnippet's suggestions show on the pop menu
but.....only in irony-mode(only active in my .cc),
and in global(like .el) yasinippet completely overlap comany and I can't see its suggestion or TAB to complete when there's only one candidate
[note]
this is my confiquration part for company-mode from my Completion.el and Irony.el
Completion.el
;;********
;; enable
;;********
(require 'company)
(add-hook 'after-init-hook 'global-company-mode)
;;*******************
;; confiqure company
;;*******************
;; company-idle-delay:company delay until suggestions are shown
;; (nil will cause completion menu don't pop automatically)
;; company-transformers...: weight by frequency
(setq company-idle-delay 0
company-minimum-prefix-length 2
company-show-numbers t
company-tooltip-limit 20
company-dabbrev-downcase nil
company-transformers '(company-sort-by-occurrence)
company-dabbrev-other-buffers t
)
;;**************************
;; Load as a grouped backend
;;**************************
;; company-irony-c-header : It must be loaded after irony-mode, while the backend should be grouped with company-irony, and before it. (so I try to put company-yasnippet into the group, and finally integrated yasnippet into completion pop menu!!!!!!!)
;; caution!!! company-yasnippet overlap company-mode in global
(eval-after-load 'company
'(add-to-list
'company-backends '( company-irony-c-headers company-irony company-yasnippet)))
Irony.el
;; =============
;; company mode
;; =============
(add-hook 'c++-mode-hook 'company-mode)
(add-hook 'c-mode-hook 'company-mode)
;; replace the `completion-at-point' and `complete-symbol' bindings in
;; irony-mode's buffers by irony-mode's function
(defun my-irony-mode-hook ()
(define-key irony-mode-map [remap completion-at-point]
'irony-completion-at-point-async)
(define-key irony-mode-map [remap complete-symbol]
'irony-completion-at-point-async))
(add-hook 'irony-mode-hook 'my-irony-mode-hook)
(add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options)
;; (optional) adds CC special commands to `company-begin-commands' in order to
;; trigger completion at interesting places, such as after scope operator
;; std::|
(add-hook 'irony-mode-hook 'company-irony-setup-begin-commands)
my emacs confiquration
https://github.com/frankie8518/Emacs_super_configuration
Is there any good solution or suggestion to show both yasinippet and company's suggestions on pop menu?