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

Line numbering

Expand Messages
  • Iain Duncan
    Would it be terribly difficult to allow line numbering to appear in hex? I know this is a strange request, but it would be darn useful for a musical editor
    Message 1 of 4 , Dec 11, 2003
    • 0 Attachment
      Would it be terribly difficult to allow line numbering to appear in hex? I
      know this is a strange request, but it would be darn useful for a musical
      editor thing I'm working on.

      ( If this is already possible, my appologies. I did try to search for it but
      found no mention. )

      Thanks
      Iain
    • Keith Roberts
      ... I don t think so, but you could put it into the statusline ... ... and look at the stuff on evaluating an expression {}
      Message 2 of 4 , Dec 11, 2003
      • 0 Attachment
        >-----Original Message-----
        >From: Iain Duncan [mailto:iainduncan@...]
        >Sent: Thursday, December 11, 2003 3:18 PM
        >To: vim-dev@...
        >Subject: Line numbering
        >
        >Would it be terribly difficult to allow line numbering to appear in hex? I
        >know this is a strange request, but it would be darn useful for a musical
        >editor thing I'm working on.
        >
        >( If this is already possible, my appologies. I did try to search for it
        >but
        >found no mention. )

        I don't think so, but you could put it into the statusline ...

        :h 'stl'

        and look at the stuff on evaluating an expression {}
      • Iain Duncan
        Thanks Keith, but I m afraid I don t understand your reply! Could you elucidate for a newbie? = ) Iain
        Message 3 of 4 , Dec 11, 2003
        • 0 Attachment
          Thanks Keith, but I'm afraid I don't understand your reply! Could you
          elucidate for a newbie? = )

          Iain

          >
          > I don't think so, but you could put it into the statusline ...
          >
          > :h 'stl'
          >
          > and look at the stuff on evaluating an expression {}
          >
          >
          >
        • Keith Roberts
          ... 1) You should bottom-post (put your responses BELOW, not ABOVE what you are replying to). You are probably using Outlook (or another email client which
          Message 4 of 4 , Dec 11, 2003
          • 0 Attachment
            >-----Original Message-----
            >From: Iain Duncan [mailto:iainduncan@...]
            >Sent: Thursday, December 11, 2003 3:28 PM
            >To: vim-dev@...
            >Subject: Re: Line numbering
            >
            > Keith Roberts wrote:
            >> I don't think so, but you could put it into the statusline ...
            >>
            >> :h 'stl'
            >>
            >> and look at the stuff on evaluating an expression {}
            >>
            >
            >Thanks Keith, but I'm afraid I don't understand your reply! Could you
            >elucidate for a newbie? = )
            >
            >Iain

            1) You should bottom-post (put your responses BELOW, not ABOVE what you are
            replying to). You are probably using Outlook (or another email client which
            doesn't know about bottom-posting). I use it also, but after being flamed
            repeatedly for bottom-posting, I learned to do so *in spite of* Outlook. :)
            You'll notice that I moved your response, and added mine below it.

            2) :set stl? Will show the current 'statusline' setting.
            By default, it's empty, which merely displays the buffername. I use:
            :set statusline=[%n]%f\ %m%r%y%<{%{&ff}}\ %=%l,%c%V=%p%%
            Which, among other things, adds the buffer number inside brackets on the
            left. You could put the line number there instead:
            :set statusline=[%{Nr2Hex(line('.'))}]%f\ %m%r%y%<{%{&ff}}\
            %=%l,%c%V=%p%%
            This uses the function defined below.

            3) Here's a function to return the hex equivalent of a number (from :h
            eval-examples):
            :" The function Nr2Hex() returns the Hex string of a number.
            :func Nr2Hex(nr)
            : let n = a:nr
            : let r = ""
            : while n
            : let r = '0123456789ABCDEF'[n % 16] . r
            : let n = n / 16
            : endwhile
            : return r
            :endfunc
          Your message has been successfully submitted and would be delivered to recipients shortly.