Monday, August 23, 2010

Re: Moving over wrapped lines in Insert Mode

HAKAN YILDIZ wrote:

> Hi,
>
> I was wondering if there was any setting that changes Vim's behavior so
> that pressing the down key moves the cursor to the next line on the screen
> (not on the file) in Insert Mode (similar to 'gj' in Command Mode).
>
> The default behavior becomes a problem for me when I edit files with long
> lines which are wrapped several times.
>
> Any help is highly appreciated.
>
> Hakan
>

You can put this in your $HOME/.vimrc (or $HOME/_vimrc):

" These mappings are useful in long wrapped lines when pressing <down> or <up>
" Use j or k to get the default behavior.
noremap <down> gj
noremap <up> gk

-- Dominique

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