Thursday, April 4, 2013

Re: do word jump commands without line-wrap?

On 2013-04-03 10:21, neolus wrote:
> Hi! is there any fast neat way to tell vim not to go to
> next/previous word if it's on a different line that doesn't require
> writing a function? e.g. a flag or something? I looked but can't
> find anything on it other than whichwrap but it seems that only
> applies to hjkl stuff..

You could try the following mappings:

:nnoremap w /<bslash>%<c-r>=line('.')<cr>l<bslash><lt><cr>
:nnoremap b ?<bslash>%<c-r>=line('.')<cr>l<bslash><lt><cr>

which also happens to behave in a way that makes sense with your
'wrapscan' setting. The behavior is slightly different from the
stock behaviors, as it looks for a beginning-of-word, so it doesn't
land on intermediate punctuation. But for most cases it should do
what you want.

-tim



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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: