Loading ...
Sorry, an error occurred while loading the content.

RE: show total bytes in file

Expand Messages
  • Dave Silvia
    How about: command! Where let lhere=line( . ) | let chere=col( . ) | call cursor(1,1) | call cursor(line( $ ),col( $ )) | call cursor(lhere,chere) |
    Message 1 of 3 , Aug 1, 2004
      How about:

      command! Where
      \ let lhere=line(".") |
      \ let chere=col(".") |
      \ call cursor(1,1) |
      \ call cursor(line("$"),col("$")) |
      \ call cursor(lhere,chere) |
      \ let clast=line2byte(line("$")+1)-1 |
      \ let lbytes=line2byte(lhere-1)+chere |
      \ let rbytes=clast-lbytes-1 |
      \ echo " ".lbytes.",".rbytes.",".clast

      noremap <F12> :Where<CR>

      Output is 'bytes-to-the-left,bytes-to-the-right,total-bytes' when the f12
      key is pressed, e.g., for the example code (unix fileformat), with the
      cursor on the 'c' in 'command' the output would be


      for the 't' in 'clast'


      for the '>' in '<CR>'


      Was that kinda what you had in mind?

      Dave S.

      P.S. There is an anomaly! If you're on the last line and it has no
      characters, the output is 'total-bytes',-1,'total-bytes'! There's a similar
      oddity when you're adding the first line for the first time. But as long as
      you know that:)

      -----Original Message-----
      From: rainer [mailto:lists@...]
      Sent: Sunday, August 01, 2004 5:03 AM
      To: vim@...
      Subject: show total bytes in file

      is it possible to show the total bytes in the file while i am editing
      it left or right from "line,char" ?
      so long,
      Rainer Bendig aka mindz PGP/GPG key (ID: 0xCC7EA575)
      http://DigitallyImpressed.com Get it from wwwkeys.de.pgp.net
      for contacting me take a look on http://digitallyimpressed.com/contact
      Don't reply to this e-mail address and please don't cc to me on lists.
      If we meet on a list, you can be sure that i am already on the list.
    Your message has been successfully submitted and would be delivered to recipients shortly.