Vim - get output of EX mode into a variable
08:06 09 Apr 2013

I'm writing a Vim script where I need to get the first line of the current buffer. In Ex mode, I can simply type 1 and it shows me the content I want.

How can I put the output of the ex command into a variable in Vim?

vim ex