summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrekado <rekado@elephly.net>2016-11-22 21:59:34 +0100
committerrekado <rekado@elephly.net>2016-11-23 15:32:31 +0100
commita57802fbdaf7877d4d30d9ec58a5d850f3b83a44 (patch)
tree53e9ac173e34d22e949c9ea925eddecad6dc89ad
parenta982fd37d3f8b2314efc67b6a549c8437d2a20b9 (diff)
Enable completion in prog-mode only.
-rw-r--r--init.org11
1 files changed, 10 insertions, 1 deletions
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 <tab>") 'company-complete)
+#+END_SRC
+#+BEGIN_SRC elisp
(require 'color)
(let ((bg (face-attribute 'default :background)))
(custom-set-faces