0

Sometimes in VIM, I am unable to access certain lines of a file in edit mode, whether using the arrow keys or H, J, K, and L. Does this have to do with the history of my edits?

Addendum: I wonder if it has to do with the fact that I am experimenting with fixing merge conflicts in Git on the file. I have done a fair number of test edits. I am just working with lorem ipsum nonsense text. Basically, I can only access five lines of the 13 displayed in VIM in either edit or write mode. The cursor just skips past the rest and won't even enter the line.

eabates
  • 878
  • 1
  • 8
  • 22
  • 1
    In _diff mode_, Vim inserts certain filler lines (`------`); those cannot be moved into. Do you have a reproducible example? What happens, does it beep? What's your configuration? – Ingo Karkat Nov 11 '15 at 15:50
  • 1
    Possible duplicate of [how can i intuitively move cursor in vim?(not by line)](http://stackoverflow.com/questions/9713967/how-can-i-intuitively-move-cursor-in-vimnot-by-line) – Kristján Nov 11 '15 at 16:23

1 Answers1

2

My first guess would be that you have long lines which wrap, so it looks like the cursor is skipping lines when it's actually moving to the next screen line. Try using gj and gk to move up and down by screen lines rather than file lines.

As Ingo Karkat pointed out in the comments, if you're diffing files inside Vim, lines which were deleted from one of the files show up as dashes. You can't put the cursor inside the dashes because they don't correspond to a line in the file. :set diff will tell you if you're in diff mode, but you probably already know if you are.

Dan Hulme
  • 14,779
  • 3
  • 46
  • 95