In Vim, how do you get the number of lines in the current file using vimscript?
You can use line()
function:
:echo line('$')
Pressing ctrl-g
will reveal the filename, current line, the line count, your current position as a percentage, and your cursor's current column number.
You could also use
wc -l <filename>