Sunday, February 20, 2011

Re: Using no hard line breaks

On Sun, Feb 20, 2011 at 08:31:02AM EST, Sebastian Humenda wrote:
> Tim Chase <vim@tim.thechases.com> wrote on Sun, Feb 20, 2011 at 07:24:01AM -0600:
> >On 02/20/2011 07:12 AM, Sebastian Humenda wrote:

> >>> :h 'linebreak' and
> >>> :h 'breakat'

> >> With the correct key words (now), I found

> >> http://vim.wikia.com/wiki/Word_wrap_without_line_breaks

> >> Which essentially works, but I thought one could then threat the lines
> >> as logical lines with<j> and<k>.

> > I've seen many folks remap "j" and "k" (or <up> and <down>) to their
> > screen-line motions "gj" and "gk" which will move as you expect.
> > That leaves the other pair (if you remap j/k then up/down, or
> > vice-versa) for traversing physical lines.
> >
> > :nnoremap <down> gj
> > :nnoremap <up> gk

> That's great, many thanks!

Since in my case flowed long lines are the exception, I use the
following mapping:

:map <Esc>j gj
:map <Esc>k gk (¹)

If I have a long line that spans half a dozen or more screen lines for
instance, I find it a lot easier to depress the left Alt key with my
left thumb and hit j/k repeatedly (or even keep them depressed) to move
around than using the standard 'gq' and 'gq'.

It's also more mnemonic where I'm concerned.. I never manage to remember
gj/gk.. ;-)

cj

¹ The mapping I use in XTerm+GNU/screen+Vim.. Not sure about other
environments.

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