diff options
author | Guangxiong Lin <[email protected]> | 2022-07-08 22:12:27 +0800 |
---|---|---|
committer | Guangxiong Lin <[email protected]> | 2022-07-08 22:12:27 +0800 |
commit | 929f203ac89b254b23f64b29b5b4058f7d009bc5 (patch) | |
tree | 6db7bb2dd6f09ac94dffdb40747e52f61a96ad5e /.emacs.d/lisp/init-company.el | |
parent | e06f5cab66e1ff586e83f6f4f8871501fd4134d3 (diff) | |
download | dotfiles-929f203ac89b254b23f64b29b5b4058f7d009bc5.tar.gz dotfiles-929f203ac89b254b23f64b29b5b4058f7d009bc5.tar.bz2 dotfiles-929f203ac89b254b23f64b29b5b4058f7d009bc5.zip |
Update emacs config
Diffstat (limited to '.emacs.d/lisp/init-company.el')
-rw-r--r-- | .emacs.d/lisp/init-company.el | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/.emacs.d/lisp/init-company.el b/.emacs.d/lisp/init-company.el index 5f5ac5e..06ff700 100644 --- a/.emacs.d/lisp/init-company.el +++ b/.emacs.d/lisp/init-company.el @@ -1,15 +1,17 @@ (when (gx/maybe-require-package 'company) - (autoload #'global-company-mode "company" nil t) + (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)) - (add-hook 'after-init-hook #'global-company-mode 'append))) + (company-mode))) (with-eval-after-load 'company (require 'company-tng) (company-tng-configure-default) (gx/diminish 'company-mode)) -(setq company-global-modes - '(emacs-lisp-mode go-mode ledger-mode sh-mode c++-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) |