raze
raze

Reputation: 11

Emacs. Truncate long lines

I remember I found a sample .emacs-file once, where long lines were truncated. I know about the build-in modes, but this mode behaved differently. It kept every line the same length, and didn't fill up the entire screen. Like this:

bla bla bla bla bla bla

bla bla bla bla bla bla

instead of

bla bla bla bla bla bla bla bla bla bla bla bla

If I end the first line with a newline (enter), then the rest of the lines follows this maximum length.

I want this because it makes it easier to read on a big widescreen monitor. Hope you understand what I mean :) Thanks in advance!

Upvotes: 1

Views: 813

Answers (2)

ZelluX
ZelluX

Reputation: 72585

You may use fill-paragraph to truncate long lines (select the long lines first). Its default key binding is M-q. Meanwhile, you can also enable auto-fill-mode to truncate long lines automatically.

Upvotes: 0

phimuemue
phimuemue

Reputation: 35973

I'm not sure what you want to achieve, so I can just propose two modes I know:

  • auto-fill-mode makes a newline if the line reaches 80 chars (or so)
  • visual-line-mode makes emacs act like a "usual" text editor (w.r.t. line wrappings)

Upvotes: 2

Related Questions