-1

I'm using vim on a very small screen device (7 inch); I use wrap and linebreak, and you can imagine that scrolling (by keyboard and mouse) is a nightmare since if you have a very long line, it can wrap below the visible screen.

I've looked through many posts and none offers a definitive solution other than gj and gk.

To clarify: just try to write a long line that goes below the visible window: ctrl-e or j k will go to the beginning of the next line and you will not see the last characters of the first line.

Is there something that I didn't find? It seems that there are really many persons interested in this, but not a single developer that wants to handle this :-(

thanks

http://vim.1045645.n5.nabble.com/Scrolling-screen-lines-I-knew-it-s-impossible-td3358342.html

gianni
  • 126
  • 10
  • 3
    Can you give a clearer definition of the problem you are having? I scroll with `Ctrl+e` or with `j` or `k`. I can tell that you're asking a deeper question I just can't tell what that is. – Ben Mordecai Feb 09 '13 at 23:37

2 Answers2

5

gj and gk will scroll within a line, rather than moving to the next line. This might help you out. If it does, you might want to temporarily do:

:nmap j gj
:nmap k gk
ngm
  • 7,277
  • 1
  • 53
  • 62
1

the closest I could get is this, no mouse support anyway:

Traversing text in Insert mode

http://vim.wikia.com/wiki/Move_cursor_by_display_lines_when_wrapping

"use up and down to move by screen line
map <Up> gk
map <Down> gj
vmap <Up> gk
vmap <Down> gj
inoremap <Up> <C-o>gk
inoremap <Down> <C-o>gj

" make hjkl movements accessible from insert mode via the <Alt> modifier key
inoremap <A-h> <C-o>h
inoremap <A-j> <C-o>gj
inoremap <A-k> <C-o>gk
inoremap <A-l> <C-o>l
Community
  • 1
  • 1
gianni
  • 126
  • 10