From: Peng Li Date: Mon, 21 Nov 2016 03:40:55 +0000 (+0800) Subject: emacs - mapping SPACE in company active mode to workaround a semantic X-Git-Url: http://47.100.26.94:8080/?a=commitdiff_plain;h=536badf9a7823ebbf252d078a20901060159ca80;p=dotfiles.git emacs - mapping SPACE in company active mode to workaround a semantic issue https://github.com/company-mode/company-mode/issues/614 --- diff --git a/emacs.d/config.org b/emacs.d/config.org index 77e72b0..9cfa09a 100644 --- a/emacs.d/config.org +++ b/emacs.d/config.org @@ -1977,6 +1977,7 @@ here on Mac, just use "open" commands to pen =.pdf=, =.html= and image files :config (define-key company-active-map (kbd "M-n") nil) (define-key company-active-map (kbd "M-p") nil) + (define-key company-active-map (kbd "SPC") #'sd/company-stop-input-space) (define-key company-active-map (kbd "C-n") #'company-select-next) (define-key company-active-map (kbd "C-p") #'company-select-previous) ;; should map both (kbd "TAB") and [tab],https://github.com/company-mode/company-mode/issues/75 @@ -1990,6 +1991,12 @@ here on Mac, just use "open" commands to pen =.pdf=, =.html= and image files :ensure t :config (company-statistics-mode)) + + (defun sd/company-stop-input-space () + "Stop completing and input a space,a workaround of a semantic issue `https://github.com/company-mode/company-mode/issues/614'" + (interactive) + (company-abort) + (insert " ")) #+END_SRC ** YASnippet