8

I am finding myself using the point d'irony (⸮) more and more. However, vim spelling does not recognise it as a valid punctuation character.

How can I add it to vim so that the spelling works?

  • According to the [vim documentation](http://vimdoc.sourceforge.net/htmldoc/spell.html), you need to regenerate/modify the spelling dictionaries of vim to change the "word characters". – jofel Sep 02 '14 at 13:17

2 Answers2

5

One way to solve this problem is to add the character directly to vim as a defined punctuation mark. The way you do this is modify the vim source file, mbyte.c, and then recompile vim. This file is located in the main /src trunk (see https://code.google.com/p/vim/source/browse/src/mbyte.c). The function you want to modify starts like this:

/*
* Get class of a Unicode character.
* 0: white space
* 1: punctuation
* 2 or bigger: some class of word character.
*/
int
utf_class(c)
int c;
{
   /* sorted list of non-overlapping intervals */
   static struct clinterval
   {
      unsigned int first;
      unsigned int last;
      unsigned int class;
   } classes[] =
      {
         {0x037e, 0x037e, 1}, /* Greek question mark */
         {0x0387, 0x0387, 1}, /* Greek ano teleia */
         {0x055a, 0x055f, 1}, /* Armenian punctuation */
         {0x0589, 0x0589, 1}, /* Armenian full stop */
         ... etc and so on

You add your character to this list and it will be treated as punctuation after you recompile.

Tyler Durden
  • 5,411
  • 16
  • 57
  • 96
1

As umläute suggested in a comment, to Tyler Durden's answer, I opened a feature request/bug report issue 258 in vim. The fix is in patch 7.4.444.