[LaTeX] Define open-line-and-indent

master
Jacopo De Simoi 7 years ago
parent 53287c2084
commit e24e8ca43d
  1. 8
      global.org

@ -962,6 +962,7 @@
("<f4>" . ( lambda() (interactive) (message "Use C-c C-c")))
("C-c C-c" . ( lambda() (interactive) (compile "/home/jacopods/scripts/latex-mk")) )
("~" . wilder/TeX-replace-tilde)
("C-o" . wilder/open-line-and-indent)
;; Force moves around to be more “semantic”
("C-v" . forward-paragraph)
("M-v" . backward-paragraph)
@ -1090,6 +1091,13 @@
(unless (char-equal (following-char) ?\s)
(insert " "))) ;; decide what to do with the point
#+END_SRC
This function opens a line and indents it
#+BEGIN_SRC emacs-lisp
(defun wilder/open-line-and-indent (arg)
"This function opens a line using (open-line) and indents it"
(interactive "p")
(open-line arg)
(save-excursion (forward-char arg) (unless (eolp) (indent-according-to-mode))))
#+END_SRC
This inserts a plain reference (or a reference to an equation with
prefix arg)

Loading…
Cancel
Save