aboutsummaryrefslogtreecommitdiff
path: root/.emacs.d/lisp/init-company.el
blob: 06ff700e55308cf2f87f062f565f9ac294c2e335 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
(when (gx/maybe-require-package 'company)
  (add-hook 'ledger-mode-hook #'gx/company-mode-in-tui)
  (add-hook 'prog-mode-hook #'gx/company-mode-in-tui))

(defun gx/company-mode-in-tui ()
  "Enable company mode in TUI."
  (when (not (display-graphic-p))
    (company-mode)))

(with-eval-after-load 'company
  (require 'company-tng)
  (company-tng-configure-default)
  (gx/diminish 'company-mode))

(setq company-minimum-prefix-length 1
      company-idle-delay (lambda () (if (company-in-string-or-comment) nil 0.01))
      company-selection-wrap-around t)

(provide 'init-company)