1

I'm trying to build a diacritic plugin which It's just a list of commands like

ia <leader>'e é " this one is source just fine
ia <leader>ae æ " This one causes error

But I'm seeing an error E474 when the file gets sourced.

I can't find a way to debug it, any help with this?

5
  • try the :scriptencoding command Mar 28, 2023 at 6:01
  • I my tests the problem is not related to the æ character but to the <leader>ae sequence. If you try ia ae æ I believe it will work. I don't what are the lhs that are refused by ia. Mar 28, 2023 at 7:37
  • 1
    @Ekiim, is the answer addressing your question or do you have some aspect that are not addressed. If the proposed solution address your question I would propose you to accept it using the v button next to the arrow voting buttons. It allow the question to rest :-) Mar 30, 2023 at 14:21
  • 1
    It did help a lot, Thanks @VivianDeSmedt
    – ekiim
    Apr 2, 2023 at 22:31
  • Thanks for the feedback :-) Apr 3, 2023 at 5:09

1 Answer 1

1

Not every character sequences are acceptable for abbreviation (see: :h abbreviation).

To determine if a sequence is supported the last character is important.

If the last character is a non-keyword character (usually a letter, a number or an underscore) the sequence is supported (non-id sequence). Example are: #foo#, foo#, bar##

If the last character is a keyword character there are two types of sequence supported:

  1. The part before is only made of keyword characters (full-id sequence). Example are: foo, bar
  2. The part before is only made of non-keyword characters (end-id sequence). Example are: #a, #.#b

If the last character is a keyword you can't mix keyword and non-keyword on the first part. Example are: \ae

Remark: The definition of what is a keyword character can be configured using the iskeyword option (more information with :h 'iskeyword')

I could recommend you to either use the suffix approach:

ia e'\ é
ia ae\ æ

Or use the following answer that propose to check the character before the abbreviation and delete it before inserting the abbreviation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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