Save current line in variable

vim

Solution

let lineText = getline('.')

See `:h getline()`…

If you only want the number:

let lineNumber = line('.')

Problem

How can I read the current line (where the cursor is) and save it to a variable in VimScript?

Original source