Tuesday, October 5, 2010

Re: zt,zm,zb horizontally ?

On Tue, October 5, 2010 2:22 pm, Jürgen Krämer wrote:
> meino.cramer@gmx.de wrote:
>> when browsing long lines (not wrapped) of text I often wish
>> to know whether there is something like zt,zm,zb for horizontal
>> movements.... ?
>
> have you had a look at
>
> :help scroll-horizontal
>
> ? That's the section just after :help zt etc. and it has information
> about ze and zs which might be helpful in your case. Alas, I don't see
> a command to center the cursor horizontally.

Make one ;)
:nnoremap <expr> z\| winwidth(0)/2 . '\|'

and then use z| to move the cursor to the center of the screen line (does
not consider wrapping).

regards,
Christian

--
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

No comments:

Post a Comment