0

I find that navigating text files that have been word wrapped somewhat difficult in vi. If there is a line that is word-wrapped and it goes down several lines, then it is hard to navigate around this line using the arrow keys. If you're on a line that's word-wrapped and you press up, it won't go up to the line above, it will go up several lines. How can this be fixed?

tony_sid
  • 14,321
  • 53
  • 141
  • 195

1 Answers1

5

If your vi is really Vim, then you can move up and down a screen column using gk and gj. Since two keystrokes per movement isn't convenient, you can create a mapping to make it easier, e.g.,

:nnoremap k gk
:nnoremap j gj

or

:nmap <Up> gk
:nmap <Down> gj
garyjohn
  • 35,330