branch: master commit fe203762f78c163001b76f1a91ff8ce56079f88d Author: Nikita Leshenko <nik...@leshenko.net> Commit: Nikita Leshenko <nik...@leshenko.net>
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