mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
Smarter dumb indentation
This commit is contained in:
@ -75,11 +75,12 @@ whitespace as possible, or just one char if that's not possible."
|
||||
(t (backward-delete-char-untabify 1))))
|
||||
|
||||
;;;###autoload
|
||||
(defun narf/dumb-indent ()
|
||||
(defun narf/dumb-indent (&optional smart)
|
||||
"Inserts a tab character (or spaces x tab-width). Checks if the
|
||||
auto-complete window is open."
|
||||
(interactive)
|
||||
(if indent-tabs-mode
|
||||
(if (or (and smart (looking-back "^[\s\t]*"))
|
||||
indent-tabs-mode)
|
||||
(insert "\t")
|
||||
(let* ((movement (% (current-column) tab-width))
|
||||
(spaces (if (zerop movement) tab-width (- tab-width movement))))
|
||||
|
Reference in New Issue
Block a user