Not every character sequences are acceptable for abbreviation (see: :h abbreviation
).
In particularTo determine if you start witha sequence is supported the last character is important.
If the last character is a non-keyword character (e.g. <leader>)
and end withusually a keyword character (e.g. a
letter, a number or an underscore) then you can only have that one ending keyword character in the sequence is supported (e.g. 'anon-id
orsequence). Example are: '#a#foo#
is ok but, 'eafoo#
or, 'e#abar##
is not) since your
If the last character is a keyword character there are intwo types of sequence supported:
- The part before is only made of keyword characters (
full-id
sequence). Example are:foo
,bar
- 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: end-id\ae
case.
Quoting the docRemark: youThe definition of what is a keyword character can either be configured using the iskeyword
option (more information with :h 'iskeyword'
)
I could recommend you to either use the suffix approach:
full-id
: Only contains keyword characters:foo
,g3
end-id
: Only contains non-keyword character but the last one:#i
,..f
,$/7
non-id
: Ends with non keyword character:def#
,..f#
ia e'\ é
ia ae\ æ
TheOr use the following answer could help you in your quest for a solutionthat propose to check the character before the abbreviation and delete it before inserting the abbreviation.