Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

term inside emacs:: how to turn "word wrap" off

Tags:

bash

emacs

In setting up my personal Linux command line development environment, I want to use term inside emacs b/c then I can switch to 'line mode' and copy/paste the output into any other buffer.

However, when I run mysql inside term inside emacs, the pretty sql tables still word wrap according to the width of that emacs window :(. I was hoping that emacs would truncate the bash output.

Is there a way to do this?

EDIT:

toggle-truncate-lines is on, so "word wrap" is off, but the problem is that before emacs even does anything with the text, the underlying bash process itself manually adds newlines to wrap text according to the width it's told it's using. That's at least how it acts. toggling truncate lines on/off doesn't change anything for me in the term buffer

like image 308
Alexander Bird Avatar asked Oct 09 '10 22:10

Alexander Bird


People also ask

How do I wrap text in Emacs?

To enable text wrapping only in the file you're working with, use the M-x function call and type visual-line-mode . (Remember, you can use tab auto completion to add the rest the of the command.) Bear in mind, visual line mode will disable itself when you close this file or quit emacs.

How do I turn off wrap text in Vim?

Command to toggle word wrap in Vim While :set wrap will turn on word wrap in Vim and :set nowrap will turn off word wrapping, you can also use both commands with the ! (bang) symbol to toggle word wrap.


1 Answers

I think what you probably want is "M-x toggle-truncate-lines". That toggles between wrapping or requiring you to scroll right and left to see the entire line.

like image 112
JOTN Avatar answered Oct 19 '22 07:10

JOTN