Skip to content

Instantly share code, notes, and snippets.

@tek-nishi
Last active November 16, 2018 00:27
Show Gist options
  • Save tek-nishi/a7fc3933be5e62c7eeaa to your computer and use it in GitHub Desktop.
Save tek-nishi/a7fc3933be5e62c7eeaa to your computer and use it in GitHub Desktop.
insert newline and indent
(defun my-insert-newline-and-indent(arg)
"カーソル行の上や下に一行挿入してインデント(前置引数が4だと下の行に挿入)"
(interactive "p")
(let ((p (if (eq arg 4)
2
1)))
(move-beginning-of-line p)
(open-line 1)
(indent-for-tab-command)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment