Long lines and scrolling...

35 views
Skip to first unread message

Conker

unread,
Mar 12, 2010, 10:08:14 AM3/12/10
to vim...@googlegroups.com

I have set wrap and linebreak options, also display=lastline to show the
beginning of lines, that don’t fit entirely on the screen. Keys are mapped,
so that up/down keys scroll vertically the displayed rows of a wrapped line.
However, when i scroll to onto that last line that is only half displayed,
the beginning of this line is put at the very top of the screen (so most of
it can be displayed), instead of just smoothly scrolling down one row. Got
no idea how to fix that.
--
View this message in context: http://old.nabble.com/Long-lines-and-scrolling...-tp27876340p27876340.html
Sent from the Vim - General mailing list archive at Nabble.com.

Charles Campbell

unread,
Mar 12, 2010, 10:57:02 AM3/12/10
to vim...@googlegroups.com
Conker wrote:
> I have set wrap and linebreak options, also display=lastline to show the
> beginning of lines, that don�t fit entirely on the screen. Keys are mapped,

> so that up/down keys scroll vertically the displayed rows of a wrapped line.
> However, when i scroll to onto that last line that is only half displayed,
> the beginning of this line is put at the very top of the screen (so most of
> it can be displayed), instead of just smoothly scrolling down one row. Got
> no idea how to fix that.
>
:help gj
:help gk

Regards,
Chip Campbell

Conker

unread,
Mar 12, 2010, 4:09:19 PM3/12/10
to vim...@googlegroups.com

Charles Campbell wrote:
>
> :help gj
> :help gk
>

How does that help? gk and gj is what up/down keys are mapped do. It’s not
the movement, that is wrong, but the display. I don’t want the whole line to
pup up, once i’ve moved onto it. I don’t see how this help pages help in any
way.
--
View this message in context: http://old.nabble.com/Long-lines-and-scrolling...-tp27876340p27882864.html

Teemu Likonen

unread,
Mar 13, 2010, 2:54:45 AM3/13/10
to vim use
* 2010-03-12 13:09 (-0800), Conker wrote:

> I don’t want the whole line to pup up, once i’ve moved onto it. I
> don’t see how this help pages help in any way.

Your original question is quite common on this list but unfortunately
Vim just can't operate optimally with very long, wrapped lines. Option
"set display=lastline" is useful, though.

Conker

unread,
Mar 16, 2010, 6:23:44 PM3/16/10
to vim...@googlegroups.com

Teemu Likonen-2 wrote:
>
> Your original question is quite common on this list but unfortunately
> Vim just can't operate optimally with very long, wrapped lines.
>

I just can't believe, that there is no way to customize that. I've not used
vim before, so I'm quite noobish too it, but I liked it, since I first saw
it. I'm probably gonna stick with it - also because I don't want to learn
all different keystrokes again - but this one thing is really bugging me.
Every other editor I know, once I scroll onto a wrapped line, scrolls down
the display for just one screen line and displays only the beginning of
line, the cursor is beeing place on, if it is wrapped - and not all the rest
of it, too, resulting in being pushed out of the current view into a new
view, several screen lines further down. This does not only make reading
continuesly very hard, because your eyes have to move up several lines, but
also is it possible, that in case of very long lines, that don't even fit on
screen when they're wrapped, I will never actually see the last line before
the long one and the long one itsself on screen together, which makes
editing very hard, too. I don't know a lot editors I admit, but this seem
the most unnatural thing to do and I don't see, why it would not be
implemented - at least as an optional view if not as the default.


Teemu Likonen-2 wrote:
>
> Option "set display=lastline" is useful, though.
>

That option I have set but it only effects the display in that way, that the
line is displayed, even though it does not fit on screen. Vim still wants to
show the whole line once you're on it. Also I noticed 'scrolloff', which
specifies, how many text lines to display from the cursor position. Set to
0, you won't see any line under the cursor, if it is on the last line of the
screen. I guess, if this value was settable to a negative value, vim would
not even insist on displaying the very one line, the cursor is on - but it
is'nt. However, a single option to tell vim, that the value of scrolloff is
too be taken for display lines and not for text lines, would be, what makes
me happy.

I'm now using a very unsatisfying workaround by setting a value to
'textwidth', so I don't even get long lines. But this is only applieable to
text passages (like in a tex file) and not to any syntax related stuff (like
also in tex files).

Still hoping, that there is another more effictive way of doing this.

/Conker
--
View this message in context: http://old.nabble.com/Long-lines-and-scrolling...-tp27876340p27925326.html

Gary Johnson

unread,
Mar 16, 2010, 7:29:35 PM3/16/10
to vim...@googlegroups.com

Vim is basically a graphical line editor. It is designed for
editing files containing lines of text that are relatively short.
It considers a line to be a fundamental unit of text. A lot of its
commands are oriented toward manipulating lines and navigating by
lines. This paradigm works really well for files that are
structured that way, as most files in Vim's application domain are.

Some editors consider a text file to contain one long stream of
characters, some of which happen to be end-of-line characters.
That's a valid model but it's not Vim's model.

One of the consequences of Vim's model is that it can be awkward to
edit extremely long lines of text or even lines that are long enough
to wrap. A number of commands have been added to Vim to make such
editing easier, but you can't get away completely from some
restrictions.

I'm not aware of any compelling advantages to maintaining text as
very long lines, so I don't think there's been a lot of motivation
to change that aspect of Vim's behavior. It may not _have_ to be
that way, and I don't know Bram's plans for the future, but for now,
it _is_ that way.

The best solution is probably to adapt your editing style to match
Vim's paradigm.

For the text portion of TeX files the line length shouldn't matter
since TeX ignores the length and type of white space (except for
blank lines) anyway. I can't think of any TeX commands that would
be so long as to fill an entire screen.

Regards,
Gary

Tony Mechelynck

unread,
May 11, 2010, 1:45:22 AM5/11/10
to vim...@googlegroups.com, Conker
On 12/03/10 16:08, Conker wrote:
>
> I have set wrap and linebreak options, also display=lastline to show the
> beginning of lines, that don’t fit entirely on the screen. Keys are mapped,
> so that up/down keys scroll vertically the displayed rows of a wrapped line.
> However, when i scroll to onto that last line that is only half displayed,
> the beginning of this line is put at the very top of the screen (so most of
> it can be displayed), instead of just smoothly scrolling down one row. Got
> no idea how to fix that.

With 'display' set to "lastline" (and 'wrap' on) you will see as much
data as will fit onscreen, with @@@ at the end of the last screen line
if that line doesn't fit. However, one thing to keep in mind is that,
with one exception, the following are always true in Vim:

- The first line of a window always starts at the start of a file line.
- The line containing the cursor is always shown in its entirety.

The one exception is when the line containing the cursor is too long to
fit within the current window. Then Vim will display as much as it can,
including the cursor, with possible truncation at both top and bottom.

This means that when repeatedly hitting j to place the cursor on
successive lines, occasionally (with 'wrap' on) there will be some
"jerky" movements:

- when it is necessary to move the first visible line off the screen,
that line will move away as one block. If it is a long line and occupies
several "screen lines", all those lines will move away together.

- when it is necessary to move the next line into the window in order to
place the cursor on it, it will also become fully displayed (if it
fits), thus possibly (if it is a long line) moving several lines off the
top of the window.

If all your lines are too long to fit within a window, then the only
time when you'll perhaps see smooth scrolling is when moving from one
point to another of a single "file line". When moving from one "very
long line" to the next, the whole current line will move away to make
place for the new line to be displayed, or part of it if it doesn't fit.


Best regards,
Tony.
--
CUSTOMER: You're not fooling anyone y'know. Look, isn't there something
you can do?
DEAD PERSON: I feel happy... I feel happy.
[whop]
CUSTOMER: Ah, thanks very much.
MORTICIAN: Not at all. See you on Thursday.
CUSTOMER: Right.
The Quest for the Holy Grail (Monty
Python)

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply all
Reply to author
Forward
0 new messages