I have the following in my init file.

;; ======= Company mode set up ============
(use-package company
  :ensure t
  :defer t
  :init (add-hook 'after-init-hook 'global-company-mode)
  (use-package company-irony :ensure t :defer t)
  (define-key company-active-map (kbd "TAB") 'company-complete-common-or-cycle)
  (define-key company-active-map (kbd "<tab>") 'company-complete-common-or-cycle)
  (define-key company-active-map (kbd "S-TAB") 'company-select-previous)
  (define-key company-active-map (kbd "<backtab>") 'company-select-previous)
  (setq company-require-match 'never)
  (setq company-idle-delay              nil
        company-minimum-prefix-length   2
        company-show-numbers            t
        company-tooltip-limit           20
        company-dabbrev-downcase        nil
        company-backends                '((company-irony company-gtags)))
  :bind ("C-;" . company-complete-common))

I also use helm-flyspell like so:

(require 'helm-flyspell)
(define-key flyspell-mode-map (kbd "C-.") 'helm-flyspell-correct)

Now when I do C-. it gives me a helm buffer with the usual ability to select the correct spelling. The problem is when I want to do company-complete-common I do C-;. However, I have found that C-; is bound to the variable flyspell-auto-correct-previous-word whenever I am in latex mode.

What I want is for C-; to be bound to company-complete-common at all times and flyspell-auto-correct-previous-word bound to some other key combination. Perhaps map it to f12. How can I do this without messing up what I already have? Thanks.


Just customize flyspell-auto-correct-binding to <f12>.

  • How do I do that?. I tried to do (define-key flyspell-mode-map (kbd "<f12>") 'flyspell-auto-correct-previous-word). But then my f key stopped working. As in the letter f of the keyboard. :) – minibuffer Jul 11 '18 at 6:19
  • @minibuffer I intentionally wrote customize. If you use the customization interface the input <f12> works. – Tobias Jul 11 '18 at 7:02
  • Thank you for your answer. But I am not a fan of customize except to change colors on faces etc. The reason is after a while I might forget I made this change and not know what I did. When I have a piece of code on my init file it is more tangible for me. – minibuffer Jul 11 '18 at 10:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.