Function: viper-autoindent

viper-autoindent is an interactive and byte-compiled function defined in viper-cmd.el.gz.

Signature

(viper-autoindent)

Documentation

Auto Indentation, Vi-style.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/emulation/viper-cmd.el.gz
(defun viper-autoindent ()
  "Auto Indentation, Vi-style."
  (interactive)
  (let ((col (current-indentation)))
    (if abbrev-mode (expand-abbrev))
    (if viper-preserve-indent
	(setq viper-preserve-indent nil)
      (setq viper-current-indent col))
    ;; don't leave whitespace lines around
    (if (memq last-command
	      '(viper-autoindent
		viper-open-line viper-Open-line
		viper-replace-state-exit-cmd))
	(indent-to-left-margin))
    ;; use \n instead of newline, or else <Return> will move the insert point
    ;;(newline 1)
    (insert "\n")
    (viper-indent-line viper-current-indent)
    ))