Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 5 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
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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