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?

link|improve this question

74% accept rate
feedback

1 Answer

up vote 4 down vote accepted

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
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.