E474 invalid argument with Unicode MATH BOLD characters. help please

9 views
Skip to first unread message

Lasse Hillerøe Petersen

unread,
Jul 20, 2023, 2:31:14 AM7/20/23
to vim_use
I am trying to add am iabbrev ".h" for 𝐡𝐞𝐥𝐥𝐨.
I type
:iabbrev .h 𝐡𝐞𝐥𝐥𝐨
(Yes, I have a Linux xkb layout so I can type this.)
I get E474 Invalid argument.
Other Unicode characters, like æøå or ¬ also don't seem to work.

I have tried setting encoding to utf-8
:set enc=utf-8
:set tenc=utf-8

Searching for the error code came up with nothing useful. Where can I find doc on what is actually *valid* arguments?

Thank you in advance.

Christian Brabandt

unread,
Jul 20, 2023, 2:44:07 AM7/20/23
to vim...@googlegroups.com
Hm, that should work and certainly does here. Does it work when you use
vim --clean?

What is your vim version please?


Mit freundlichen Grüßen
Christian
--
Wie man sein Kind nicht nennen sollte:
Anna Kasse

Lasse Hillerøe Petersen

unread,
Jul 20, 2023, 3:20:59 AM7/20/23
to vim_use
It turns out I was *completely* wrong in my assumption about the cause of this error. Sorry.
(Probably better error messages could be helpful here, like: stating *which* argument is invalid, *why* it is invalid, and *what* would be valid.)
It is not the Unicode at all, I am very happy to say.

However, for some reason there are some abbreviation "names" that seem to be invalid. ".al" is one. ".wh" seems to be another. I find it impossible to see a pattern, I can appreviate to two or three characters, even four. It seems abbreviations starting with "." or "," can only be two characters total, except I can do this
:iab ... ellipse
and it works fine.
So what can and can *not* be used for naming abbreviations, when, and *why not*?

The problem also occurs with vim --clean.

I am using Vim 8.2 on Devuan (that's what is in Devuan's repos.)

Lasse Hillerøe Petersen

unread,
Jul 20, 2023, 3:24:14 AM7/20/23
to vim_use
Oh, and shame on me for using the .h example instead of copying one I actually had tried verbatim. ".h" works fine. Add an "e" :iab he hello - and it gives E474.

Christian Brabandt

unread,
Jul 20, 2023, 3:29:13 AM7/20/23
to vim...@googlegroups.com

On Do, 20 Jul 2023, Lasse Hillerøe Petersen wrote:

> Oh, and shame on me for using the .h example instead of copying one I
> actually had tried verbatim. ".h" works fine. Add an "e" :iab he hello -
> and it gives E474.

There are only certain kinds of Abbreviations allowed. Please read the
help at `:h abbreviation` and check the section about "three types of
abbreviations".

Note: if you place your commands into a buffer, turn on search
highlighting (:set hls) and search for `/\k` Vim will highlight all
keyword characters so you can easily see if you are using an allowed
form of abbreviation.

Best,
Christian
--
Man ist niemals zu schwer für seine Größe, aber man ist oft zu klein
für sein Gewicht.
-- Gert Fröbe
Reply all
Reply to author
Forward
0 new messages