summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2020-11-09 08:00:43 -0600
committerCase Duckworth2020-11-09 08:00:43 -0600
commit06cf887f5eb8e8715628deba7771397661879062 (patch)
tree37008eadb70ece61e5302d2f448787e097901aab
parentActually apply rm-whitelist changes (diff)
downloademacs-06cf887f5eb8e8715628deba7771397661879062.tar.gz
emacs-06cf887f5eb8e8715628deba7771397661879062.zip
Use tabs instead of spaces; install smart-tabs-mode
-rw-r--r--config.org39
1 files changed, 38 insertions, 1 deletions
diff --git a/config.org b/config.org index 3b17ff4..c1b868a 100644 --- a/config.org +++ b/config.org
@@ -527,8 +527,45 @@ I was using company, but I think it might've been causing issues with ~awk-mode~
527#+END_SRC 527#+END_SRC
528** Tabs & Spaces 528** Tabs & Spaces
529#+BEGIN_SRC emacs-lisp 529#+BEGIN_SRC emacs-lisp
530 (cuss indent-tabs-mode nil)
531 (cuss sentence-end-double-space t) 530 (cuss sentence-end-double-space t)
531
532 ;; cf https://dougie.io/emacs/indentation/
533 ;; Create a variable for our preferred tab width
534 (setq custom-tab-width 4)
535
536 ;; Two callable functions for enabling/disabling tabs in Emacs
537 (defun disable-tabs () (setq indent-tabs-mode nil))
538 (defun enable-tabs ()
539 (setq indent-tabs-mode t)
540 (setq tab-width custom-tab-width))
541
542 ;; Hooks to Enable Tabs
543 (add-hook 'prog-mode-hook 'enable-tabs)
544 ;; Hooks to Disable Tabs
545 (add-hook 'lisp-mode-hook 'disable-tabs)
546 (add-hook 'emacs-lisp-mode-hook 'disable-tabs)
547
548 ;; Language-Specific Tweaks
549 (setq-default python-indent-offset custom-tab-width) ;; Python
550 (setq-default js-indent-level custom-tab-width) ;; Javascript
551
552 ;; Make the backspace properly erase the tab instead of
553 ;; removing 1 space at a time.
554 (setq backward-delete-char-untabify-method 'hungry)
555
556 ;; WARNING: This will change your life
557 ;; (OPTIONAL) Visualize tabs as a pipe character - "|"
558 ;; This will also show trailing characters as they are useful to spot.
559 (setq whitespace-style '(face tabs tab-mark trailing))
560 (custom-set-faces
561 '(whitespace-tab ((t (:foreground "#636363")))))
562 (setq whitespace-display-mappings
563 '((tab-mark 9 [124 9] [92 9]))) ; 124 is the ascii ID for '\|'
564 (global-whitespace-mode) ; Enable whitespace mode everywhere
565
566 (use-package smart-tabs-mode
567 :init
568 (smart-tabs-insinuate 'c 'javascript))
532#+END_SRC 569#+END_SRC
533* Programming 570* Programming
534** Git 571** Git