Company Autocompletion System

about | blog | config | notes | github

Company is an autocompletion system that we will use for programming languages in GNU/Emacs.

1. Configuration

1.1. Company

Use C-n and C-p to navigate tooltip.

(use-package company
  :disabled
  :diminish company-mode
  :hook (prog-mode . company-mode)
  :config
  (setq company-minimum-prefix-length 1
        company-idle-delay 0.1
        company-selection-wrap-around t
        company-tooltip-align-annotations t
        ; show tooltip even for single candidate
        company-frontends '(company-pseudo-tooltip-frontend
                            company-echo-metadata-frontend))
  (with-eval-after-load 'company
    (define-key company-active-map (kbd "C-n") 'company-select-next)
    (define-key company-active-map (kbd "C-p") 'company-select-previous)
    (define-key company-active-map (kbd "RET") 'company-complete-selection)
    (define-key company-active-map (kbd "TAB") 'company-complete-common)))

1.2. Pacakge Provies

(provide 'init-company)

Created: 2021-11-13

Emacs 26.1 (Org mode 9.5)