Today I Learned

hashrocket A Hashrocket project

Get character without diacritical mark in vim

I have the character 'ä' in vim and when I press ga on that character I get.

<a>  97,  Hex 61,  Octal 141 < ̈> 776, Hex 0308, Octal 1410

So this is a character composed of two bytes, if I want to get the first byte (a) programmatically I can uise the strpart function.

:echo strpart("ä", 0, 1)
a

This function starts at 0 and gets the first byte.

See More #vim TILs
Every developer at Hashrocket is a Vim expert. Check out our development environment, Dotmatrix, and if you are in Chicago, come to the Vim Chicago Meetup hosted at our Chicago office.