fosstodon.org is one of the many independent Mastodon servers you can use to participate in the fediverse.
Fosstodon is an invite only Mastodon instance that is open to those who are interested in technology; particularly free & open source software. If you wish to join, contact us for an invite.

Administered by:

Server stats:

10K
active users

In my adveture of today, I wanted to have something similar to what vim does with the `O` key. Insert a line above the current one. I found that C-o and C-S-o are bound to the same ~(open-line)~ function, which is nearly what I wanted.

code in the next message :)

Roberto :emacs::mastodon:

This is my new tweak:

(defun open-line-above-and-indent ()
"Insert a new line above the current one maintaining the indentation."
(interactive)
(let ((current-indentation (current-indentation)))
(beginning-of-line)
(open-line 1)
(when (> current-indentation 0)
(indent-to current-indentation))))

(global-set-key (kbd "C-S-o") #'open-line-above-and-indent)

is great!