From a57802fbdaf7877d4d30d9ec58a5d850f3b83a44 Mon Sep 17 00:00:00 2001 From: rekado Date: Tue, 22 Nov 2016 21:59:34 +0100 Subject: Enable completion in prog-mode only. --- init.org | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/init.org b/init.org index 7e23893..6e4850f 100644 --- a/init.org +++ b/init.org @@ -564,11 +564,20 @@ The default prompt face makes it hard to see the prompt. :noweb-ref: completion :END: +Company mode provides automatic completion. I like to enable it in all programming modes. I don’t use the global company mode because that would enable it in =org-mode= where the pop-up looks terrible with =variable-pitch-mode= enabled. + +#+BEGIN_SRC elisp +(add-hook 'prog-mode-hook 'company-mode) +#+END_SRC + +I like automatic completion, but it’s nice to also have a key to trigger completion. + #+BEGIN_SRC elisp -(add-hook 'after-init-hook 'global-company-mode) (setq company-idle-delay 0.5) (define-key company-mode-map (kbd "C-c ") 'company-complete) +#+END_SRC +#+BEGIN_SRC elisp (require 'color) (let ((bg (face-attribute 'default :background))) (custom-set-faces -- cgit v1.2.3