1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

flyspell overrides company key bindings

Discussion in 'Technology' started by minibuffer, Oct 8, 2018.

  1. minibuffer

    minibuffer Guest

    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.

    Login To add answer/comment

Share This Page