Tim Chase wrote:

is it possible to tell vim(7) *not* to jump to the next line
when using object motion (w,b..) such as vim behaves when
using l or h ?


Please give specific example of what you type in normal mode involving w or b that jumps to the next line, please.

When I use w or yw vim does not jump to the next line.


If I understand the OP correctly, given the following text

    this is line one
    this is line two

with the cursor on the "l" of line #1, pressing "w" goes to the "o" in "one". Pressing "w" a second time jumps to the "t" in "this" on the 2nd line as observed here...if it's not happening for you, the difference between your settings, Yakov, and our settings is the answer to the OP's question.

However, if you are on the "e" in "one", and press ell to go right, it does not end up on the "t" in "this" on the 2nd line.

It sounds like the OP wants the behavior of "w" (and its kin) to mimic the behavior of ell, such that it doesn't jump to the next line. I run with a fairly stock vimrc, as I suspect the OP does. Do you have any funky settings in your vimrc, Yakov, that might trigger this behavior for you and not for us?

I wouldn't know how to easily do what the OP asked; the opposite, that of making vim change lines with h or l *is* possible (see :help 'ww' ). I'm sure that some smart mapping could do the trick. As an example: (untested)

nnoremap b :let curline= line(".")<bar>exe "norm! b"<bar>if curline != line(".")|exe "norm! w"|endif

Should be easy to re-write for handling w.

Regards,
Chip Campbell

Reply via email to