Previous: , Up: Moving by Line   [Index]


6.5.2.2 Visual Line Mode

A minor mode that builds on the concept of visual lines with additional functionality. Visual Line Mode wraps by word boundary resulting in “cleaner” word wrapping like what you’d see in a traditional word processor. The minor mode will also disable the fringe indicators.

Additionally, Visual Line Mode replaces a number of movement and editing commands with visual equivalents. ‘C-p’ and ‘C-n’ will behave as they do in default Emacs installations with the line-move-visual option enabled.

Furthermore, commands like moving to the beginning and end of a line (with ‘C-a’ and ‘C-e’) now work on visual lines instead of logical lines.

The kill command (bound to ‘C-k’) will also work on visual lines.

Function: visual-line-mode &optional arg

Toggle visual line-based editing (Visual Line mode) in the current buffer.

When Visual Line mode is enabled, ‘word-wrap’ is turned on in this buffer, and simple editing commands are redefined to act on visual lines, not logical lines.

Function: global-visual-line-mode

Visual-Line mode is enabled in all buffers where ‘turn-on-visual-line-mode’ would do it.

Function: toggle-truncate-lines &optional ARG

When truncating is off, long lines are folded.