When I use :set iskeyword? to view keyword characters, result for shell scripts is:


:h iskeyword says @ expands to any alpha character that the isalpha() functions returns true on, but what about 48-57 and 192-255 how can I view these characters?


You can use:

:echo map(range(48, 57), 'nr2char(v:val)')
:echo map(range(192, 255), 'nr2char(v:val)')

Which should output:

['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']

['À', 'Á', 'Â', 'Ã', 'Ä', 'Å', 'Æ', 'Ç', 'È', 'É', 'Ê', 'Ë', 'Ì', 'Í', 'Î', 'Ï', 'Ð', 'Ñ', 'Ò', 'Ó', 'Ô', 'Õ', 'Ö', '×', 'Ø', 'Ù', 'Ú', 'Û', 'Ü', 'Ý', 'Þ', 'ß', 'à', 'á', 'â', 'ã', 'ä', 'å', ' æ', 'ç', 'è', 'é', 'ê', 'ë', 'ì', 'í', 'î', 'ï', 'ð', 'ñ', 'ò', 'ó', 'ô', 'õ', 'ö', '÷', 'ø', 'ù ', 'ú', 'û', 'ü', 'ý', 'þ', 'ÿ']

To break it down:

  • range(192, 255) makes a list from 192 to 255.
  • nr2char() converts a number from its ASCII code to a string.
  • map() applies nr2char() to every item in the list.
| improve this answer | |
  • Works great, thanks. I'm assuming the characters in range (192-255) are not normal ascii. is that some kind of "extended ascii"? – the_velour_fog Apr 1 '16 at 23:27
  • the_velor_fog: ASCII only has 7bit. Those are Unicode codepoints. You can go much higher than 255. – sapanoia Nov 5 '17 at 18:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.