       ;; Rewrite evil-complete to use company-dabbrev
       (setq company-dabbrev-code-other-buffers t)
       (setq company-dabbrev-code-buffers nil)
-
       (setq evil-complete-next-func
             (lambda(arg)
               (call-interactively 'company-dabbrev)
               (if (eq company-candidates-length 1)
                 (company-complete))))
-
       (setq evil-complete-previous-func
             (lambda (arg)
               (let ((company-selection-wrap-around t))

      ;; Simulates ac-source-dictionary (without global dictionary)
      (defconst my-dicts-dir (concat my-dir "dict/"))
      (defvar company-dictionary-alist '())

      (defun company-dictionary (command &optional arg &rest ignored)
        "`company-mode' back-end for programming language keywords."
        (interactive (list 'interactive))
        (unless company-dictionary-alist
          (dolist (file (f-files my-dicts-dir))
            (add-to-list 'company-dictionary-alist `(,(intern (f-base file)) ,@(s-split "\n" (f-read file) t)))))
        (cl-case command
          (interactive (company-begin-backend 'company-dictionary))
          (prefix (and (assq major-mode company-dictionary-alist)
                       (or (company-grab-symbol) 'stop)))
          (candidates
           (let ((completion-ignore-case nil)
                 (symbols (cdr (assq major-mode company-dictionary-alist))))
             (all-completions arg (if (consp symbols)
                                      symbols
                                    (cdr (assq symbols company-dictionary-alist))))))
          (sorted t)))

    (progn ; keybinds
      (bind 'insert company-mode-map

    ;; Sort candidates by
    (add-to-list 'company-transformers 'company-sort-by-occurrence)
    ;; (add-to-list 'company-transformers 'company-sort-by-backend-importance)
    (use-package company-statistics
      :config
      (progn
        (setq company-statistics-file (expand-file-name "company-statistics-cache.el" my-tmp-dir))
        (company-statistics-mode)))

    (progn ; frontends
      (setq-default company-frontends '(company-pseudo-tooltip-unless-just-one-frontend
