How to go to next line on the screen instead of going to next line in the text?
  Home FAQ Contact Sign in
gnu.emacs.help only
 
Advanced search
POPULAR GROUPS

more...

gnu.emacs.help Profile…
 Up
How to go to next line on the screen instead of going to next line in the text?         


Author: xz
Date: May 30, 2008 18:09

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, just like what happens when you hit the down arrow key
in gedit or the notepad in Windows.

How to do that?
9 Comments
Re: How to go to next line on the screen instead of going to next line in the text?         


Author: Giorgos Keramidas
Date: May 30, 2008 22:34

On Fri, 30 May 2008 18:09:41 -0700 (PDT), xz gmail.com> wrote:
> 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, just like what happens when you hit the down arrow key
> in gedit or the notepad in Windows.
>
> How to do that?

Check out `longlines-mode'. I think you'll like it :)
no comments
Re: How to go to next line on the screen instead of going to next line in the text?         


Author: B. T. Raven
Date: May 31, 2008 12:29

xz wrote:
> 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, just like what happens when you hit the down arrow key
> in gedit or the notepad in Windows.
>
> How to do that?

The best way I know is to use isearch (C-s) for two or three characters
before the one you want the cursor moved to and then isearch-exit which
I have bound to M-s. (I use a Dvorak layout so you may want to bind to
some other keychord) M-s is center-line in textmode but this is
overridden in the context of isearch.

Ed
no comments
Re: How to go to next line on the screen instead of going to next line in the text?         


Author: Sébastien Vauban
Date: Jun 2, 2008 04:16

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)))
Show full article (1.07Kb)
no comments
Re: How to go to next line on the screen instead of going to next line in the text?         


Author: xz
Date: Jun 3, 2008 09:35

On May 31, 12:34 am, Giorgos Keramidas
wrote:
> On Fri, 30 May 2008 18:09:41 -0700 (PDT), xz gmail.com> wrote:
>> 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, just like what happens when you hit the down arrow key
>> in gedit or the notepad in Windows.
>
>> How to do that?
>
Thank you for your reply
> Check out `longlines-mode'.  I think you'll like it :)
Show full article (0.89Kb)
1 Comment
Re: How to go to next line on the screen instead of going to next line in the text?         


Author: Kevin Rodgers
Date: Jun 4, 2008 06:24

xz wrote:
> On May 31, 12:34 am, Giorgos Keramidas
> wrote:
>> Check out `longlines-mode'. I think you'll like it :)
>
> I think this is what I want.
> But one more question, how to turn on this mode automatically every
> time when I launch emacs?
> Should I simply put the following line in the .emacs file? Or what
> else should I do?
>
> (longlines-mode)

Long Lines mode is a minor mode, local to each buffer. So you'll
need to turn it on in every buffer where you want it, which can be
done 2 ways: via major mode hooks or via file visiting hooks.

Here's the first way:
(add-hook 'text-mode-hook 'longlines-mode)
...
(add-hook 'foo-mode-hook 'longlines-mode)
Show full article (0.87Kb)
no comments
Re: How to go to next line on the screen instead of going to next line in the text?         


Author: xz
Date: Jun 4, 2008 07:48

On Jun 4, 8:24 am, Kevin Rodgers gmail.com> wrote:
> xz wrote:
>> On May 31, 12:34 am, Giorgos Keramidas
>> wrote:
>>> Check out `longlines-mode'.  I think you'll like it :)
>
>> I think this is what I want.
>> But one more question, how to turn on this mode automatically every
>> time when I launch emacs?
>> Should I simply put the following line in the .emacs file? Or what
>> else should I do?
>
>> (longlines-mode)
>
> Long Lines mode is a minor mode, local to each buffer.  So you'll
> need to turn it on in every buffer where you want it, which can be
> done 2 ways: via major mode hooks or via file visiting hooks.
>
> Here's the first way:
> (add-hook 'text-mode-hook 'longlines-mode) ...
Show full article (1.20Kb)
no comments
Re: How to go to next line on the screen instead of going to next line in the text?         


Author: xz
Date: Jun 4, 2008 07:53

~~~
> which means, if I only want turn on this longlines-mode when editing
> latex/tex file, then I add the following to .emacs:
> (add-hook 'tex-mode-hook 'longlines-mode)
>
> Is that correct?
> But it seems not working......
>

I mean it works when I add
(add-hook 'text-mode-hook 'longlines-mode)

while it does work if I only add
(add-hook 'tex-mode-hook 'longlines-mode)
Show full article (0.58Kb)
1 Comment
Re: How to go to next line on the screen instead of going to next line in the text?         


Author: Kevin Rodgers
Date: Jun 4, 2008 22:41

xz wrote:
> ~~~
>> which means, if I only want turn on this longlines-mode when editing
>> latex/tex file, then I add the following to .emacs:
>> (add-hook 'tex-mode-hook 'longlines-mode)
>>
>> Is that correct?
>> But it seems not working......
>>
>
> I mean it works when I add
> (add-hook 'text-mode-hook 'longlines-mode)
>
> while it does work if I only add
> (add-hook 'tex-mode-hook 'longlines-mode)
>
>
>>
>>> Here's the second way:
>>> (add-hook 'find-file-hook 'longlines-mode) ...
Show full article (1.93Kb)
no comments
Re: How to go to next line on the screen instead of going to next line in the text?         


Author: xz
Date: Jun 5, 2008 08:05

On Jun 5, 12:41 am, Kevin Rodgers gmail.com> wrote:
> xz wrote:
>> ~~~
>>> which means, if I only want turn on this longlines-mode when editing
>>> latex/tex file, then I add the following to .emacs:
>>> (add-hook 'tex-mode-hook 'longlines-mode)
>
>>> Is that correct?
>>> But it seems not working......
>
>> I mean it works when I add
>> (add-hook 'text-mode-hook 'longlines-mode)
>
>> while it does work if I only add
>> (add-hook 'tex-mode-hook 'longlines-mode)
>
>>>> Here's the second way:
>>>> (add-hook 'find-file-hook 'longlines-mode)
>>>> (add-hook 'find-file-not-found-functions 'longlines-mode)
> ...
Show full article (2.33Kb)
no comments