sponsor Vim development Vim logo Vim Book Ad

intermediate Tip #67: Ascii Value

 tip karma   Rating 214/104, Viewed by 7809 

created:   May 7, 2001 5:56      complexity:   intermediate
author:   Erhan      as of Vim:   5.7

Sometimes we, the programmers, need the value of a character, don't we?
You can learn the ascii value of a character by pressing g and a keys.(ga)!
It displays the value in dec, hex and octal...

 rate this tip  Life Changing Helpful Unfulfilling 

<<Transfer text between two Vim 'sessions', | Delete key >>

Additional Notes

[email protected], May 9, 2001 6:35
You can also add options to the statusline option to show what the
ascii value of the character under the cursor is.

set statusline=%<%f%h%m%r%=%b 0x%B  %l,%c%V %P
                           ^^^^^^^^

The underlined part is what does it.
[email protected], May 9, 2001 22:29
The mnemonic I use to remember ga is "get ascii" but I guess that is an obvious one...
[email protected], June 5, 2001 5:00
doesn't work with multibyte editing :-(
Alexey Marinichev, June 7, 2001 14:57
For multibyte use g8.
[email protected], August 30, 2006 3:45
all i want is a backwards 3, where the 3 is facing the other  way.....
If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to [email protected] after searching the archive. Help Bram help Uganda.
    stats
Sponsored by Web Concept Group Inc. SourceForge.net Logo