Closed tgpfeiffer closed 8 years ago
The binding only needs to be set once, so you can do:
(with-eval-after-load 'company
(define-key company-mode-map (kbd "TAB") #'company-indent-or-complete-common))
Still though, it's quite common to use company in org mode as well. Perhaps suggest another binding or leave the choice for the user.
The sample code shouldn't suggest adding a lambda hook, which can be a pain to remove (because remove-hook
doesn't work as expected).
How about writing this in the readme?
(define-key rust-mode-map (kbd "TAB") #'company-indent-or-complete-common)
This is far less likely to clash with existing keybindings that users may have.
I've made the proposed change. Let us know if you have further issues.
For me, the sample code to set the TAB key to autocomplete given in the Readme,
caused problems with org-mode, where TAB wouldn't work any more to indent. I suggest to change the sample code to
to avoid these problems.