From a904f66f66dc5a01e3315ede954833757bd11e7e Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 4 Jan 2021 14:20:26 -0600 Subject: Add company --- config.org | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/config.org b/config.org index 1b81d0d..5e4021b 100644 --- a/config.org +++ b/config.org @@ -1163,6 +1163,42 @@ For right now, I’m /just/ using Anzu – I don’t like parts of =isearch= but (global-aggressive-indent-mode +1) #+END_SRC +** Completion + + #+begin_src emacs-lisp + (straight-use-package 'company) + + (add-hook 'prog-mode-hook #'company-mode) + + (cuss company-idle-delay 0.1 + "Show company sooner.") + (cuss company-minimum-prefix-length 3 + "Don't try to complete short words.") + + (with-eval-after-load 'company + (define-key company-active-map (kbd "C-n") + (lambda () (interactive) (company-complete-common-or-cycle +1))) + (define-key company-active-map (kbd "C-p") + (lambda () (interactive) (company-complete-common-or-cycle -1)))) + #+end_src + +*** Give it a frame and better help + + #+begin_src emacs-lisp + (straight-use-package 'company-posframe) + + (with-eval-after-load 'company + (company-posframe-mode +1)) + #+end_src + +*** Prescient integration + + #+begin_src emacs-lisp + (straight-use-package 'company-prescient) + + (add-hook 'company-mode-hook #'company-prescient-mode) + #+end_src + ** Language-specific packages *** Emacs lisp @@ -1537,6 +1573,15 @@ I’ve put org mode under Applications, as opposed to Writing, because it’s m (define-key beancount-mode-map (kbd "M-p") #'outline-previous-visible-heading) #+end_src +*** Company integration with company-ledger + + #+begin_src emacs-lisp + (straight-use-package 'company-ledger) + + (with-eval-after-load 'company + (add-to-list 'company-backends 'company-ledger)) + #+end_src + ** PDF Tools I’m only enabling this at home for now, since it requires building stuff. -- cgit 1.4.1-21-gabe81