Last Updated: February 25, 2016
·
1.999K
· endel

VIM: Get buffer byte size

It's useful when you need to check your buffer size before saving it into the disk.

function! s:BufferByteSize()
  echo printf("%s %s", line2byte(line('$') + 1), "bytes")
endfunction
command! Bytes call s:BufferByteSize()