cleanup open new line and indent

master
Jacopo De Simoi 3 years ago
parent 9586c26e42
commit 658ba299ba
  1. 14
      global.org

@ -462,10 +462,16 @@
#+end_src #+end_src
** Smart open-line ** Smart open-line
#+begin_src emacs-lisp #+begin_src emacs-lisp
(defun open-line-and-indent () (defun open-line-and-indent (arg)
(interactive) (interactive "*p")
(save-excursion (newline-and-indent)) (save-excursion
(indent-line)) (newline-and-indent)
(skip-chars-forward "[:blank:]")
(when (eolp)
(let ((e (point))
(b (progn (beginning-of-line) (point))))
(delete-region b e))))
(funcall indent-line-function))
(global-set-key (kbd "C-o") #'open-line-and-indent) (global-set-key (kbd "C-o") #'open-line-and-indent)
#+end_src #+end_src

Loading…
Cancel
Save