Discussion:
Scroll horizontally without moving cursor
James M Beck
2007-08-10 14:37:50 UTC
Permalink
Hi all,

How would I scroll the window left and right, without moving the cursor?
I'm looking for something similar to the way C-y and C-e move the screen
up and down.

Thanks,
--
James M. Beck

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---
Ben Schmidt
2007-08-10 14:54:05 UTC
Permalink
Post by James M Beck
How would I scroll the window left and right, without moving the cursor?
I'm looking for something similar to the way C-y and C-e move the screen
up and down.
:help scroll-horizontal

Basically it's z followed by a horizontal movement (left, right, h, l).

Ben.



Send instant messages to your online friends http://au.messenger.yahoo.com


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---
Tony Mechelynck
2007-08-10 15:18:42 UTC
Permalink
Post by James M Beck
Hi all,
How would I scroll the window left and right, without moving the cursor?
I'm looking for something similar to the way C-y and C-e move the screen
up and down.
Thanks,
All the following require ":setlocal nowrap" and the cursor on a line longer
than the window width.

Adapted from ":help scroll-horizontal":

[count]zl scroll the text [count] characters to the left (default 1).
[count]z<Right> same as zl
[count]zh scroll the text [count] characters to the right (default 1).
[count]z<Left> same as zh
zL scroll the text half a screenwidth left
zH scroll the text half a screenwidth right
zs scroll to put the cursor at the left margin
ze scroll to put the cursor at the right margin.

You can also use the mouse on the horizontal scrollbar.

Note: In Vim, the cursor position for the current window MUST always be
visible. If you scroll the cursor position off the screen, the cursor will
move to remain on-screen.


Best regards,
Tony.
--
On his first day as a bus driver, Maxey Eckstein handed in
receipts of $65. The next day his take was $67. The third day's
income was $62. But on the fourth day, Eckstein emptied no less than
$283 on the desk before the cashier.
"Eckstein!" exclaimed the cashier. "This is fantastic. That
route never brought in money like this! What happened?"
"Well, after three days on that cockamamie route, I figured
business would never improve, so I drove over to Fourteenth Street and
worked there. I tell you, that street is a gold mine!"

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---
James M Beck
2007-08-10 15:22:37 UTC
Permalink
Thanks guys. I have no idea why I didn't see what I was looking for in the
help files, but this is exactly what I wanted.

On Fri, 10 Aug 2007 10:18:42 -0500, Tony Mechelynck
Post by Tony Mechelynck
Post by James M Beck
Hi all,
How would I scroll the window left and right, without moving the cursor?
I'm looking for something similar to the way C-y and C-e move the screen
up and down.
Thanks,
All the following require ":setlocal nowrap" and the cursor on a line longer
than the window width.
[count]zl scroll the text [count] characters to the left (default 1).
[count]z<Right> same as zl
[count]zh scroll the text [count] characters to the right (default 1).
[count]z<Left> same as zh
zL scroll the text half a screenwidth left
zH scroll the text half a screenwidth right
zs scroll to put the cursor at the left margin
ze scroll to put the cursor at the right margin.
You can also use the mouse on the horizontal scrollbar.
Note: In Vim, the cursor position for the current window MUST always be
visible. If you scroll the cursor position off the screen, the cursor will
move to remain on-screen.
Best regards,
Tony.
--
James M. Beck
Office: 281.483.1575

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---
Continue reading on narkive:
Loading...