mirror of
https://github.com/Foltik/dotfiles
synced 2024-11-24 04:22:50 -05:00
Flesh out indentation stuff
This commit is contained in:
parent
fd92b046a7
commit
3fc2e5077e
@ -699,29 +699,39 @@ Set some *sane* defaults
|
||||
#+END_SRC
|
||||
Define some *useful* helper functions
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(defun foltz-indent-tabs ()
|
||||
(interactive)
|
||||
(setq tab-width foltz-tab-width)
|
||||
(local-set-key (kbd "") 'tab'to-tab-stop)
|
||||
(defun jf-indent-tabs (width)
|
||||
(interactive "nTab width: ")
|
||||
(setq tab-width width)
|
||||
(local-set-key (kbd "TAB") 'tab-to-tab-stop)
|
||||
(setq indent-tabs-mode t))
|
||||
|
||||
(defun foltz-indent-spaces (num-spaces)
|
||||
(interactive)
|
||||
(setq tab-width num-spaces)
|
||||
(defun jf-indent-spaces (num)
|
||||
(interactive "nNumber of spaces: ")
|
||||
(setq tab-width num)
|
||||
(setq indent-tabs-mode nil))
|
||||
(defun foltz-indent-2-spaces ()
|
||||
(foltz-indent-spaces 2))
|
||||
(defun foltz-indent-4-spaces ()
|
||||
(foltz-indent-spaces 4))
|
||||
(defun foltz-indent-8-spaces ()
|
||||
(foltz-indent-spaces 8))
|
||||
|
||||
(foltz-indent-4-spaces)
|
||||
;; Default
|
||||
(jf-indent-spaces 4)
|
||||
|
||||
;; Define functions for every level of indent that might need hooking
|
||||
(cl-macrolet
|
||||
((jf-define-indent-funs (widths)
|
||||
`(progn
|
||||
,@(mapcan
|
||||
(lambda (num)
|
||||
`((defun ,(intern (concat "jf-indent-" (number-to-string num) "-spaces")) ()
|
||||
(jf-indent-spaces ,num))
|
||||
(defun ,(intern (concat "jf-indent-tabs-" (number-to-string num))) ()
|
||||
(jf-indent-tabs ,num))))
|
||||
widths))))
|
||||
(jf-define-indent-funs (2 4 8)))
|
||||
|
||||
;; TODO: Replace with dedicated whitespace config
|
||||
(setq whitespace-style '(face tabs tab-mark trailing))
|
||||
(custom-set-faces
|
||||
'(whitespace-tab ((t (:foreground "#636363")))))
|
||||
|
||||
;; Make tabs visible
|
||||
(setq whitespace-display-mappings
|
||||
'((tab-mark 9 [124 9] [92 9])))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user