help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: How to go to next line on the screen instead of going to next line i


From: Sébastien Vauban
Subject: Re: How to go to next line on the screen instead of going to next line in the text?
Date: Mon, 02 Jun 2008 13:16:02 +0200
User-agent: Gnus/5.110009 (No Gnus v0.9) Emacs/23.0.60 (gnu/linux)

Hi,

> In emacs, if you hit the down arrow key, the cursor will go to next
> line in the text, i.e., the part after the first next '\n'.
>
> However, sometimes when the line is long and is wrapped into several
> lines on the screen, I wanna move between the screen lines, instead of
> the text lines.
>
> How to do that?

--8<---------------cut here---------------start------------->8---
;; point motion by screen lines (as opposed to text lines)
;; TODO screen lines mode enabled by default for all buffers
(when (require 'screen-lines)
    ;; following lines commented out for keeping the original `kill-line'
    ;; in `screen-lines' minor mode
    (add-hook 'screen-lines-load-hook
              (lambda ()
                (ad-disable-advice 'kill-line 'around 'screen-lines)
                (ad-activate 'kill-line)))

    ;; nothing should appear in the mode line, when the `screen-lines' mode
    ;; is enabled in a buffer
    (setq screen-lines-minor-mode-string ""))
--8<---------------cut here---------------end--------------->8---

Seb

-- 
Sébastien Vauban


reply via email to

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