 ;; to offer completion inside comments too.
 (setq company-dabbrev-code-everywhere t)
 
-;; Don't bother with company-dabbrev when we have company-dabbrev-code
-;; already. It's a little too aggressive at suggesting words,
-;; especially when writing comments.
-(setq company-backends
-      (remove 'company-dabbrev company-backends))
+(global-set-key (kbd "s-/") #'company-dabbrev)
+
+;; Precise completion.
 
 (global-set-key (kbd "C-z") #'company-try-hard)
 (define-key company-active-map (kbd "C-z") #'company-try-hard)

;; candidate. Otherwise, we end with a function foo shown as "foof".
(setq company-tooltip-align-annotations t)

;; Bind `company-complete' next to hippie-expand, because they're both useful.
(global-set-key (kbd "s-/") #'company-complete)

;; Use C-n and C-p when company is active (for consistency with helm).
(define-key company-active-map (kbd "C-n") #'company-select-next)
(define-key company-active-map (kbd "C-p") #'company-select-previous)

(global-set-key (kbd "s-w") #'aya-create)
(global-set-key (kbd "s-y") #'aya-expand)

;; Greedy completion.

;; dabbrev-expand should match case
(require 'dabbrev)
(setq dabbrev-case-fold-search nil)
