Less intrusive company completion

This commit is contained in:
Henrik Lissner 2016-02-23 13:11:00 -05:00
parent 3ce43bf173
commit 4c0e39c9ce
2 changed files with 12 additions and 4 deletions

View file

@ -48,7 +48,15 @@
(defun narf/company-dict-or-keywords ()
(interactive)
(let ((company-backends '((company-keywords company-dict))))
(call-interactively 'company-complete-common)))
(call-interactively 'company-complete)))
;;;###autoload
(defun narf/company-complete ()
"Bring up the completion popup. If there is only one result, auto-complete it."
(interactive)
(when (and (company-manual-begin)
(= company-candidates-length 1))
(company-complete-common)))
(provide 'defuns-company)
;;; defuns-company.el ends here

View file

@ -304,7 +304,7 @@
"C-C" (λ! (ace-window 16))) ; delete windows
;; Vim omni-complete emulation
:i "C-SPC" 'company-complete-common
:i "C-SPC" 'narf/company-complete
(:prefix "C-x"
:i "C-l" 'narf/company-whole-lines
:i "C-k" 'narf/company-dict-or-keywords
@ -323,8 +323,8 @@
"C-o" 'company-search-kill-others
"C-n" 'company-select-next
"C-p" 'company-select-previous
"C-h" 'company-show-doc-buffer
"C-S-h" 'company-show-location
"C-h" 'company-quickhelp-manual-begin
"C-S-h" 'company-show-doc-buffer
"C-S-s" 'company-search-candidates
"C-s" 'company-filter-candidates
"C-SPC" 'company-complete-common-or-cycle