Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emacs - disable wordwrapping in html-mode

Tags:

emacs

In my emacs html-mode word wrapping happens if cross the legendary limit of 80 columns. How can I disable it?

like image 880
Shiv Deepak Avatar asked Feb 15 '12 13:02

Shiv Deepak


People also ask

How do I turn off word wrap in HTML?

If you want to prevent the text from wrapping, you can apply white-space: nowrap; Notice in HTML code example at the top of this article, there are actually two line breaks, one before the line of text and one after, which allow the text to be on its own line (in the code).

How do I turn off Wrap in Emacs?

Alt + X , toggle-truncate-lines (tab completion works) will turn word wrapping off for the current document.

How do I turn off text wrapping?

Enable or disable text wrapping for a text box, rich text box, or expression box. Right-click the control for which you want to enable or disable text wrapping, and then click Control Properties on the shortcut menu. Click the Display tab. Select or clear the Wrap text check box.

What is line wrap mode?

Sometimes, a line of text in the buffer—a logical line—is too long to fit in the window, and Emacs displays it as two or more screen lines. This is called line wrapping or continuation, and the long logical line is called a continued line.


2 Answers

Word-wrapping in Emacs is done using the minor mode auto-fill-mode. You can disable it by running the command M-x auto-fill-mode RET, or by adding it to a hook:

(defun my-html-mode-hook ()
  (auto-fill-mode -1))

(add-hook 'html-mode-hook 'my-html-mode-hook)
like image 181
Lindydancer Avatar answered Sep 27 '22 15:09

Lindydancer


Add this to your .emacs:

(defun my-html-mode-setup ()
  (auto-fill-mode -1))
(add-hook 'html-mode-hook 'my-html-mode-setup)
like image 41
Trey Jackson Avatar answered Sep 27 '22 16:09

Trey Jackson