From da8b0294c506fa83ab5bc9459f39be700dbe9b37 Mon Sep 17 00:00:00 2001 From: sooheon Date: Sun, 17 Apr 2016 15:26:30 +0900 Subject: [PATCH] Wrap company kb changes in check for user prefs Only use evilified bindings in company-active-map if user wants vim style or hjkl bindings. --- layers/+completion/auto-completion/packages.el | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/layers/+completion/auto-completion/packages.el b/layers/+completion/auto-completion/packages.el index c5b1485b3..3880b45a4 100644 --- a/layers/+completion/auto-completion/packages.el +++ b/layers/+completion/auto-completion/packages.el @@ -103,13 +103,16 @@ (spacemacs//auto-completion-set-RET-key-behavior 'company) (spacemacs//auto-completion-set-TAB-key-behavior 'company) (spacemacs//auto-completion-setup-key-sequence 'company) - (let ((map company-active-map)) - (define-key map (kbd "C-/") 'company-search-candidates) - (define-key map (kbd "C-M-/") 'company-filter-candidates) - (define-key map (kbd "C-d") 'company-show-doc-buffer) - (define-key map (kbd "C-j") 'company-select-next) - (define-key map (kbd "C-k") 'company-select-previous) - (define-key map (kbd "C-l") 'company-complete-selection)) + (when (or (eq 'vim dotspacemacs-editing-style) + (and (eq 'hybrid dotspacemacs-editing-style) + hybrid-mode-enable-hjkl-bindings)) + (let ((map company-active-map)) + (define-key map (kbd "C-/") 'company-search-candidates) + (define-key map (kbd "C-M-/") 'company-filter-candidates) + (define-key map (kbd "C-d") 'company-show-doc-buffer) + (define-key map (kbd "C-j") 'company-select-next) + (define-key map (kbd "C-k") 'company-select-previous) + (define-key map (kbd "C-l") 'company-complete-selection))) ;; Nicer looking faces (custom-set-faces '(company-tooltip-common