[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Word wrap and horizontal scrolling

From: Yuri Khan
Subject: Re: Word wrap and horizontal scrolling
Date: Mon, 14 Mar 2011 10:48:11 +0600

On Sun, Mar 13, 2011 at 21:53, Alexander Stepanov <address@hidden> wrote:
> I am still trying to make emacs work as usual Windows text editor such
> as Notepad++ and MS Visual Studio. I can turn off word wrap in Notepad+
> + and it will show horizontal scrollbar. To do such in emacs i must
> input M-x toggle-truncate-lines and scroll to the left and to the
> right using C-PgDn and C-PgUp. But this method scrolls code with too
> big offset.

You can press C-h k C-PgDn and learn that scroll-left accepts an
optional argument that specifies how much to scroll, and that the
default is window width minus two. Then, you have options.

Firstly, you can specify this argument each time you use scroll-left:
C-u 20 C-PgDn will scroll by 20 columns.

Alternatively, you can write your own version with a different default
and bind it to C-PgDn:

(defun my-scroll-left (&optional arg set-minimum)
    (interactive "P")
    (scroll-left (or arg 4) set-minimum))
(global-set-key (kbd "C-<next>") 'my-scroll-left)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]