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

Any way of getting statusline=%B in insert mode?

Expand Messages
  • DervishD
    Hi all, and happy new year! I have %B in my status line, but it doesn t work in insert mode, only on normal and visual mode. At first I thought that the status
    Message 1 of 11 , Jan 2, 2007
    • 0 Attachment
      Hi all, and happy new year!

      I have %B in my status line, but it doesn't work in insert mode,
      only on normal and visual mode. At first I thought that the status line
      wasn't being evaluated while in insert mode, but the line and column
      numbers change correctly, so it *is* being evaluated, it's just that %B
      doesn't seems to work.

      Any way of working around this problem? Is this a feature?

      Thanks a lot in advance :)

      Raúl Núñez de Arenas Coronado

      --
      Linux Registered User 88736 | http://www.dervishd.net
      It's my PC and I'll cry if I want to... RAmen!
    • A.J.Mechelynck
      ... IMHO, I said. Bram has the final say, not me. ... Best regards, Tony.
      Message 2 of 11 , Jan 2, 2007
      • 0 Attachment
        DervishD wrote:
        > Hi Tony :)

        :-) Olá Raúl

        >
        > * A.J.Mechelynck <antoine.mechelynck@...> dixit:
        >> DervishD wrote:
        >>> I have %B in my status line, but it doesn't work in insert mode,
        >>> only on normal and visual mode. At first I thought that the status line
        >>> wasn't being evaluated while in insert mode, but the line and column
        >>> numbers change correctly, so it *is* being evaluated, it's just that %B
        >>> doesn't seems to work.
        >>>
        >> I confirm that in Insert/Replace mode %B gives a single digit zero. In
        >> Select mode it works OK, even in Select (insert) i.e. when triggered
        >> by hitting shift-arrow in Insert mode.
        >
        > OK, thanks for the confirmation.
        >
        >> Even in Insert mode, the display is OK in non-current windows (e.g.
        >> clicking a status line or using Ctrl-O Ctrl-W w to change windows,
        >> gives a correct display on the status line of the window which we just
        >> left).
        >
        > So really it is a bug and not a feature. Again, thanks :)

        IMHO, I said. Bram has the final say, not me.

        >
        > Raúl Núñez de Arenas Coronado
        >

        Best regards,
        Tony.
      • DervishD
        Hi Tony :) ... It s Hola , but thanks for the nice gesture :))))) ... Of course, but given that even in the GUI version the problem happens (I thought that
        Message 3 of 11 , Jan 3, 2007
        • 0 Attachment
          Hi Tony :)

          * A.J.Mechelynck <antoine.mechelynck@...> dixit:
          > DervishD wrote:
          > > Hi Tony :)
          > :-) Olá Raúl

          It's "Hola", but thanks for the nice gesture :)))))

          > > So really it is a bug and not a feature. Again, thanks :)
          >
          > IMHO, I said. Bram has the final say, not me.

          Of course, but given that even in the GUI version the problem
          happens (I thought that the bar was in between characters, and not at
          the 25% leftmost position), I'm inclined to think it is a bug and not a
          feature. Specially because it is a bit annoying, when moving around in
          insert mode, not being able to know the byte value of a character when I
          need to. Of course, I can switch to normal mode or map something to "g8"
          in insert mode, but...

          Thanks for all and à bientôt :))

          Raúl Núñez de Arenas Coronado

          --
          Linux Registered User 88736 | http://www.dervishd.net
          It's my PC and I'll cry if I want to... RAmen!
        • A.J.Mechelynck
          DervishD wrote: [...] ... ga (or in Insert mode Ctrl-O ga) is what you want: g8 is used in UTF-8 to show the actual bytes which represent the character: e.g.
          Message 4 of 11 , Jan 3, 2007
          • 0 Attachment
            DervishD wrote:
            [...]
            > Of course, but given that even in the GUI version the problem
            > happens (I thought that the bar was in between characters, and not at
            > the 25% leftmost position), I'm inclined to think it is a bug and not a
            > feature. Specially because it is a bit annoying, when moving around in
            > insert mode, not being able to know the byte value of a character when I
            > need to. Of course, I can switch to normal mode or map something to "g8"
            > in insert mode, but...

            ga (or in Insert mode Ctrl-O ga) is what you want: g8 is used in UTF-8 to show
            the actual bytes which represent the character: e.g. on the letter é (small e
            with acute accent), ga shows "<é> 233, Hex 00e9, Octal 351" while g8 shows "c3
            a9".

            >
            > Thanks for all and à bientôt :))

            De nada, y hasta luego, amigo.

            >
            > Raúl Núñez de Arenas Coronado
            >

            Best regards,
            Tony.
          • DervishD
            Hi Tony :) ... I just didn t remember about ga, and I was using g8 most of the time O:)))) Thanks a lot for the tip :)) ... Do you speak spanish? I studied
            Message 5 of 11 , Jan 3, 2007
            • 0 Attachment
              Hi Tony :)

              * A.J.Mechelynck <antoine.mechelynck@...> dixit:
              > DervishD wrote:
              > > Of course, but given that even in the GUI version the problem
              > >happens (I thought that the bar was in between characters, and not at
              > >the 25% leftmost position), I'm inclined to think it is a bug and not a
              > >feature. Specially because it is a bit annoying, when moving around in
              > >insert mode, not being able to know the byte value of a character when I
              > >need to. Of course, I can switch to normal mode or map something to "g8"
              > >in insert mode, but...
              >
              > ga (or in Insert mode Ctrl-O ga) is what you want: g8 is used in UTF-8 to
              > show the actual bytes which represent the character: e.g. on the letter é
              > (small e with acute accent), ga shows "<é> 233, Hex 00e9, Octal 351" while
              > g8 shows "c3 a9".

              I just didn't remember about ga, and I was using g8 most of the time
              O:)))) Thanks a lot for the tip :))

              > > Thanks for all and à bientôt :))
              >
              > De nada, y hasta luego, amigo.

              Do you speak spanish? I studied french a long time ago, and I'm
              afraid I'm no longer able to maintain a conversation in french, although
              I still understand it a bit. Your spanish is for sure much better than
              my french O:)))

              Again, thanks for the nice gesture, you're very kind :)

              Raúl Núñez de Arenas Coronado

              --
              Linux Registered User 88736 | http://www.dervishd.net
              It's my PC and I'll cry if I want to... RAmen!
            • Redoute
              ... %{char2nr(getline( . )[col( . )-1])} works for me.
              Message 6 of 11 , Jan 3, 2007
              • 0 Attachment
                DervishD wrote:

                > Any way of working around this problem?

                %{char2nr(getline('.')[col('.')-1])}

                works for me.
              • DervishD
                Hi Redoute :) ... Thanks! I ve modified it a bit, because I wanted the number as hexa and always with the same width, using printf : set statusline=%y%m%r
                Message 7 of 11 , Jan 4, 2007
                • 0 Attachment
                  Hi Redoute :)

                  * Redoute <redoute@...> dixit:
                  > DervishD wrote:
                  > > Any way of working around this problem?
                  >
                  > %{char2nr(getline('.')[col('.')-1])}
                  >
                  > works for me.

                  Thanks! I've modified it a bit, because I wanted the number as hexa
                  and always with the same width, using "printf":

                  set statusline=%y%m%r\ %t%=[%L]\ %05l,%03c\ %{printf('x%02x',char2nr(getline('.')[col('.')-1]))}


                  Raúl Núñez de Arenas Coronado

                  --
                  Linux Registered User 88736 | http://www.dervishd.net
                  It's my PC and I'll cry if I want to... RAmen!
                Your message has been successfully submitted and would be delivered to recipients shortly.