diff options
author | rekado <rekado@elephly.net> | 2016-11-22 21:59:34 +0100 |
---|---|---|
committer | rekado <rekado@elephly.net> | 2016-11-23 15:32:31 +0100 |
commit | a57802fbdaf7877d4d30d9ec58a5d850f3b83a44 (patch) | |
tree | 53e9ac173e34d22e949c9ea925eddecad6dc89ad | |
parent | a982fd37d3f8b2314efc67b6a549c8437d2a20b9 (diff) |
Enable completion in prog-mode only.
-rw-r--r-- | init.org | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -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 |