summary refs log tree commit diff stats
path: root/tag-emacs
diff options
context:
space:
mode:
authorAlan Pearce2015-12-10 16:11:59 +0100
committerAlan Pearce2015-12-10 16:11:59 +0100
commit45e3307f95a1aa8d4be2383e0cc6b4d05547acc7 (patch)
tree6256a3ca3e5a2c03e1aa464ba6f7bc67d0164d05 /tag-emacs
parent8857d80bb0e1fddc8c21b8f2adbf3c270aa9429e (diff)
downloaddotfiles-45e3307f95a1aa8d4be2383e0cc6b4d05547acc7.tar.lz
dotfiles-45e3307f95a1aa8d4be2383e0cc6b4d05547acc7.tar.zst
dotfiles-45e3307f95a1aa8d4be2383e0cc6b4d05547acc7.zip
Emacs: Replace smart-tab with a simple binding
Diffstat (limited to 'tag-emacs')
-rw-r--r--tag-emacs/emacs.d/init.org47
1 files changed, 15 insertions, 32 deletions
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-<tab>" . 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-<tab>" . 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