q335r49
q335r49

Reputation: 648

Get first screen column in vim

Is there any way to get the first visible (virtual) column in a window?
For example if I have wrap off, and scroll horizontally 3 times, the first visible virtual column would be 4.

Upvotes: 1

Views: 167

Answers (2)

q335r49
q335r49

Reputation: 648

Someone from the mailing list suggested

 1 + virtcol(".") - wincol()

which also works, and makes me feel stupid.

Upvotes: 1

elmart
elmart

Reputation: 2374

Use movement g0.
See :help g0.

Upvotes: 0

Related Questions