I have set nowrap so that I can view a file properly. So what happens is that when navigating up or down in the file, if there is an empty line in between, vim takes me to the beginning of that line. I lose the view that I had previously, and I get it back only after I move a few lines up where there is text in them. This is rather irritating as while开发者_如何学运维 reading this particular file I am usually horizontally scrolled to a position much beyond the starting few columns that fit on the screen. Navigating to an empty line causes this view to be lost and I get completely empty view (because nothing is written in those columns in those rows). Is there any work around for this ?
You need to set the virtualedit
option:
set virtualedit=all
See :help virtualedit
for an explanation.
精彩评论