Re: Any way of getting statusline=%B in insert mode?
Hi Redoute :) * Redoute <[EMAIL PROTECTED]> 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!
Re: Any way of getting statusline=%B in insert mode?
DervishD wrote: > Any way of working around this problem? %{char2nr(getline('.')[col('.')-1])} works for me.
Re: Any way of getting statusline=%B in insert mode?
Hi Tony :) * A.J.Mechelynck <[EMAIL PROTECTED]> 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!
Re: Any way of getting statusline=%B in insert mode?
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.
Re: Any way of getting statusline=%B in insert mode?
Hi Tony :) * A.J.Mechelynck <[EMAIL PROTECTED]> 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!
Re: Any way of getting statusline=%B in insert mode?
Bill McCarthy wrote: [...] Perhaps. It behaves that way (also in 6.4) for both %b and %B. In Gvim, the cursor is between 2 characters - so returning zero for %b and %B seems reasonable. OTOH, supporting the bug conclusion, the character position of %c, %v and %V report the position following the between character cursor. In (g)vim, the cursor is never between characters. In gvim, with the default setting for 'guicursor', the cursor looks as if it were between characters, because it is drawn as a vertical bar occupying the leftmost 25% of its character cell; but ":set guicursor=a:block-Cursor" will show that it is indeed within a character cell (whose position is reported by %c %v %V). Best regards, Tony.
Re: Any way of getting statusline=%B in insert mode?
On Tue 2-Jan-07 12:57pm -0600, A.J.Mechelynck wrote: > DervishD wrote: >> 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 >> > > 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. > > 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). > > IMHO this is a bug. Perhaps. It behaves that way (also in 6.4) for both %b and %B. In Gvim, the cursor is between 2 characters - so returning zero for %b and %B seems reasonable. OTOH, supporting the bug conclusion, the character position of %c, %v and %V report the position following the between character cursor. -- Best regards, Bill
Re: Any way of getting statusline=%B in insert mode?
DervishD wrote: Hi Tony :) :-) Olá Raúl * A.J.Mechelynck <[EMAIL PROTECTED]> 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.
Re: Any way of getting statusline=%B in insert mode?
Hi Tony :) * A.J.Mechelynck <[EMAIL PROTECTED]> 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 :) 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!
Re: Any way of getting statusline=%B in insert mode?
DervishD wrote: 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 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. 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). IMHO this is a bug. Best regards, Tony.
Any way of getting statusline=%B in insert mode?
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!