Skip to content

Instantly share code, notes, and snippets.

@bitristan
Created August 8, 2014 08:46
Show Gist options
  • Save bitristan/62556e4b35fe53ade67c to your computer and use it in GitHub Desktop.
Save bitristan/62556e4b35fe53ade67c to your computer and use it in GitHub Desktop.
init-company-mode.el
(require 'company)
(setq company-idle-delay 0.3)
(setq company-tooltip-limit 20)
(setq company-minimum-prefix-length 2)
(setq company-echo-delay 0)
(setq company-auto-complete nil)
(global-company-mode 1)
(add-to-list 'company-backends 'company-dabbrev t)
(add-to-list 'company-backends 'company-ispell t)
(add-to-list 'company-backends 'company-files t)
(setq company-backends (remove 'company-ropemacs company-backends))
(defun my-pcomplete-capf ()
(add-hook 'completion-at-point-functions 'pcomplete-completions-at-point nil t))
(add-hook 'org-mode-hook #'my-pcomplete-capf)
(defun my-company-elisp-setup ()
(set (make-local-variable 'company-backends)
'((company-capf :with company-dabbrev-code))))
(dolist (hook '(emacs-lisp-mode-hook lisp-interaction-mode-hook))
(add-hook hook 'my-company-elisp-setup))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment