From 45e3307f95a1aa8d4be2383e0cc6b4d05547acc7 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 10 Dec 2015 16:11:59 +0100 Subject: Emacs: Replace smart-tab with a simple binding --- tag-emacs/emacs.d/init.org | 47 +++++++++++++++------------------------------- 1 file changed, 15 insertions(+), 32 deletions(-) (limited to 'tag-emacs') diff --git a/tag-emacs/emacs.d/init.org b/tag-emacs/emacs.d/init.org index b28107f..24888f9 100644 --- a/tag-emacs/emacs.d/init.org +++ b/tag-emacs/emacs.d/init.org @@ -775,30 +775,12 @@ Directional window movement Make built-in completion a bit more intelligent, by adding substring and initial-based completion and ignoring case. -** TODO With =tab-always-indent=, do I need smart-tab anymore? - #+BEGIN_SRC emacs-lisp (setq completion-styles '(basic initials partial-completion substring) completion-ignore-case t tab-always-indent 'complete) #+END_SRC -*** Smart-tab - -Most editors use tab for both completion and indentation. Smart-tab -tries to do the right thing depending on the location of the point and -the line’s current indentation. - -#+BEGIN_SRC emacs-lisp -(use-package smart-tab - :commands (global-smart-tab-mode) - :init (global-smart-tab-mode) - :diminish smart-tab-mode - :config (progn - (nconc smart-tab-completion-functions-alist '((php-mode . php-complete-function))) - (diminish 'smart-tab-mode ""))) -#+END_SRC - *** Company The main choices for automatic completion in Emacs are company and @@ -806,20 +788,21 @@ auto-complete-mode. I’ve not tried auto-complete-mode as company seems to work perfectly well for me. #+BEGIN_SRC emacs-lisp -(use-package company - :commands (company-mode) - :diminish "Cmpl" - :bind (("C-" . company-complete)) - :init (progn - (add-hook 'prog-mode-hook #'company-mode) - (setq company-backends '(company-tern (company-elisp company-bbdb company-nxml company-css company-eclim company-semantic company-clang company-xcode company-cmake company-capf company-gtags company-dabbrev-code company-etags company-keywords) - company-oddmuse company-files company-dabbrev) - company-idle-delay .3 - company-begin-commands '(self-insert-command) - company-auto-complete #'company-explicit-action-p - company-auto-complete-chars '(?\ ?\( ?\) ?.) - company-tooltip-align-annotations t - company-dabbrev-downcase nil))) + (use-package company + :commands (company-mode) + :diminish "Cmpl" + :bind (("C-" . company-complete) + ("TAB" . company-indent-or-complete-common)) + :init (progn + (add-hook 'prog-mode-hook #'company-mode) + (setq company-backends '(company-tern (company-elisp company-bbdb company-nxml company-css company-eclim company-semantic company-clang company-xcode company-cmake company-capf company-gtags company-dabbrev-code company-etags company-keywords) + company-oddmuse company-files company-dabbrev) + company-idle-delay .3 + company-begin-commands '(self-insert-command) + company-auto-complete #'company-explicit-action-p + company-auto-complete-chars '(?\ ?\( ?\) ?.) + company-tooltip-align-annotations t + company-dabbrev-downcase nil))) #+END_SRC * Dates & Times -- cgit 1.4.1