Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get Emacs to join lines when killing lines

Tags:

emacs

When I hit C-k, Emacs kills to end-of-line. When I hit C-k again, it "kills the newline" and brings the next line up. However, the next line's indentation remains intact, and you can end up with a line that has lots of spaces in the middle.

So, from this:

    previous line material
    next line material

to this:

    previous line material        next line material

I understand I can use M-^ to join lines properly, but that requires the cursor to be on the next line. How do I modify C-k so that when it kills the newline, also kills the next line's indentation?

like image 707
qrest Avatar asked Dec 21 '22 23:12

qrest


1 Answers

For C-k I don't know, but you could use the just-one-space function to transform any number of space into juste one space (it's bound on M-space)

like image 124
Rémi Avatar answered Dec 27 '22 09:12

Rémi