Nona
Nona

Reputation: 5462

Is line an ex command in vim?

I'm new to vim and I saw the following response in a vimgolf challenge:

:%s/\d\d/\=line('.')*10/<CR>ZZ

Where does the "=line('.')" come from? I've never seen it on any of the vim cheat sheets I've looked at.

Upvotes: 0

Views: 38

Answers (1)

nimrodm
nimrodm

Reputation: 23809

Try :help line.

line is a VIM function. line('.') returns the cursor position (line number).

Try this in VIM:

 :echo line('.')

Upvotes: 2

Related Questions