emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master fe20376 11/78: company-tng: Function to give sensible defa


From: Dmitry Gutov
Subject: [elpa] master fe20376 11/78: company-tng: Function to give sensible default configuration
Date: Sun, 18 Feb 2018 07:40:12 -0500 (EST)

branch: master
commit fe203762f78c163001b76f1a91ff8ce56079f88d
Author: Nikita Leshenko <address@hidden>
Commit: Nikita Leshenko <address@hidden>

    company-tng: Function to give sensible default configuration
    
    This is done to ease adoption by new users
---
 company-tng.el | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/company-tng.el b/company-tng.el
index f01462c..ab22924 100644
--- a/company-tng.el
+++ b/company-tng.el
@@ -73,6 +73,18 @@ confirm the selection and finish the completion."
        (company--unread-this-command-keys)
        (setq this-command 'company-complete-selection)))))
 
+;;;###autoload
+(defun company-tng-configure-default ()
+  "Applies the default configuration to enable company-tng."
+  (add-to-list 'company-frontends 'company-tng-frontend)
+  (let ((keymap company-active-map))
+    (define-key keymap [return] nil)
+    (define-key keymap (kbd "RET") nil)
+    (define-key keymap [tab] 'company-select-next)
+    (define-key keymap (kbd "TAB") 'company-select-next)
+    (define-key keymap [backtab] 'company-select-previous)
+    (define-key keymap (kbd "S-TAB") 'company-select-previous)))
+
 (defun company-tng--allow-unselected (&optional arg)
   "Advice `company-select-next' to allow for an 'unselected'
 state. Unselected means that no user interaction took place on the



reply via email to

[Prev in Thread] Current Thread [Next in Thread]