Path: blob/master/elisp/emacs-for-python/plugins/open-next-line.el
990 views
;; Behave like vi's o command1(defun open-next-line (arg)2"Move to the next line and then opens a line.3See also `newline-and-indent'."4(interactive "p")5(end-of-line)6(open-line arg)7(next-line 1)8(when newline-and-indent9(indent-according-to-mode)))10(global-set-key (kbd "C-o") 'open-next-line)11;; Behave like vi's O command12(defun open-previous-line (arg)13"Open a new line before the current one.14See also `newline-and-indent'."15(interactive "p")16(beginning-of-line)17(open-line arg)18(when newline-and-indent19(indent-according-to-mode)))20(global-set-key (kbd "M-o") 'open-previous-line)2122;; Autoindent open-*-lines23(defvar newline-and-indent t24"Modify the behavior of the open-*-line functions to cause them to25autoindent.")2627(provide 'open-next-line)2829