Advanced editing features of Emacs

emacs

there's a lot of noise about super awesome features of Emacs. Be it org-mode, Gnus or C-x M-c butterfly. I've used Emacs for years, so no need to convince me.

What I personally found is that nobody talks about…actually editing text. You know that

Emacs is a nice OS but it lacks an decent editor.

joke? I didn't really get it until I grokked Vim.

Now, I wrote my thesis using Emacs as my text editor, so my heart is somehow still attached to it. I'm also super envious about org-mode. So I wondered whether there maybe actually are features I've been missing all the time?

I'm going to give you a few examples I use all the time:

  • o/O opens a new line above/below the current and puts me into insert mode no matter at which position my cursor is.
  • ci' deletes the contents of current/following '-string and puts me into insert mode.
  • dat deletes the current HTML tag. cit would delete the contents and put me into insert mode. cstt would let me edit the tag (eg make a <span> into a <div>)
  • cs([ changes the surrounding "(" and ")" into "[" and "]".
  • An extension allows me to address Python indentations: dai would delete the current indented block, \\ai would comment it out (\\ is an extension).

Are there some super secret shortcuts but easily accessible shortcuts for stuff like this in Emacs? Sublime Text 2 has a few "expand selection" functions that go a similar way albeit not that precise–but still it's very useful.

P.S. Please don't bring up any vi emulation, just don't.

P.P.S. Also for god's sake, no Emacs vs. Vim vs. Whatever warfare, I beg you.

Best Answer

Since no one has said so directly, I will.

The reason emacs lacks a "decent editor" is because a large part of the point of emacs is to allow you to make the ideal editor for yourself. This is not a trivial undertaking, and there are many things that other people have written and enough people have found useful to be included in the standard distributions of it.

It's not meant to be used at the default settings, really. Really. It's not meant to be a piece of software that you poke and prod at and tweak a bit here and there so much as an editor that you can tear apart the behavior of to make into whatever you want it to be.

So, yes, yes there is either an existing equivalent of $feature from $editor, or assuming no one has written one yet you can be safe in the knowledge that you can implement it.