   (use-package company
     ;; complete anything
     :ensure t
-    :bind
-    (("<S-SPC>" . company-complete) ;; recommended to use TAB instead (which uses helm-company, see below)
-     ("M-n" . company-select-next)
-     ("M-p" . company-select-previous))
+    ;; :bind
+    ;; (("<S-SPC>" . company-complete) ;; recommended to use TAB instead (which uses helm-company, see below)
+    ;;  ("M-n" . company-select-next)
+    ;;  ("M-p" . company-select-previous))
     :init
     ;;(add-hook 'after-init-hook 'global-company-mode)
     (add-hook 'c-mode-common-hook 'company-mode)
     (add-hook 'emacs-lisp-mode-hook 'company-mode)
     (add-hook 'comint-mode-hook 'company-mode)
+    (add-hook 'LaTeX-mode-hook 'company-mode)
     ;;(add-hook 'sh-mode-hook 'company-mode)
     ;;(add-hook 'python-mode-hook 'company-mode)
     :config
+    (setq company-dabbrev-downcase 0)
     ;; set timeout to 10 seconds
     (setq company-async-timeout 10)
     ;; Cancel selections by typing non-mathcing characters
     (setq company-require-match 'never)
     ;; Minimum length of word to start completion
-    (setq company-minimum-prefix-length 10)
+    (setq company-minimum-prefix-length 2)
     ;; Autocomplete only when I explicitly mean to
     (setq company-auto-complete nil)
     (set 'company-idle-delay 1)

    (add-hook 'LaTeX-mode-hook 'auto-fill-mode)
    (add-hook 'LaTeX-mode-hook 'turn-on-reftex)
    (setq reftex-plug-into-AUCTeX t)
    )

  (use-package pdf-tools

      '(define-key company-active-map (kbd "M-h") #'company-quickhelp-manual-begin))
    )

  (use-package helm-company
    ;; Helm interface for company-mode
    :ensure t
    :config
    (eval-after-load 'company
      '(progn
	 (define-key company-mode-map (kbd "<S-SPC>") 'helm-company)
	 (define-key company-active-map (kbd "<S-SPC>") 'helm-company)))
    )

  (use-package company-shell
    ;; company mode completion backends for your shell functions:
