Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to scroll horizontally in emacs?

I can't get emacs to scroll horizontally!

To replicate the problem:

  1. Open the *scratch* buffer.
  2. Write a long line.
  3. Make the long line exceed the window width with M-xtoggle-truncate-lines. The left hand text (column 0) will now be off the left of the window.
  4. Try M-xscroll-left or its shortcut C-x < to scroll left.
  5. Type y to enable the disabled commands.
  6. NOTHING HAPPENS!

I also tried C-a to go to the beginning of the line.

I also tried M-xtoggle-horizontal-scroll-bar but got the error message "Horizontal scroll bars aren't implemented yet".

There seems to be no way to scroll horizontally!

I need this because I have many wide CSV files to read.

I'm using the latest prelude on emacs 24.5 on Windows 10.

I filed an issue on the prelude project in case it is a genuine bug and could be fixed there.

like image 499
blokeley Avatar asked Oct 29 '25 08:10

blokeley


2 Answers

You seem not to understand how horizontal scrolling works. It's not intuitive, that's why the command is disabled by default.

When I press C-x< at the end of the long line, the line disappears to the left. When I press C-x> there, nothing happens.

Pressing C-x< at the beginning of the long line, though, shows the second part of the long line.

Consider using visual-line-mode or even the csv-mode instead.

like image 131
choroba Avatar answered Oct 31 '25 05:10

choroba


There is new a feature in Emacs 26. You can customize mwheel-tilt-scroll-p and use mouse to scroll.

  1. M-x customize group RET mouse
  2. Then set mwheel-tilt-scroll-p to t
like image 44
stone2009 Avatar answered Oct 31 '25 03:10

stone2009



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!