Sunday, September 28, 2014

Re: command-line commands instead of abbreviations?

On Sun, 28 Sep 2014 20:25:27 -0700 (PDT)
Ben Fritz <fritzophrenic@gmail.com> wrote:

> On Sunday, September 28, 2014 7:08:47 PM UTC-5, Eric Christopherson
> wrote:
> > On Sun, Sep 28, 2014, Ben Fritz wrote:
> > > Easy solution: use a :normal! command within your command
> > > definition, to insert the text with 'a'.
> >
> > > E.g. :command тл normal! aтру-ля-ля

Thank you for the hint, Ben.

> >
> > That appears to be an invalid command name, as does the capitalized
> > variant Тл. Perhaps non-Roman scripts aren't supported as command
> > names?
>
> Probably. I didn't test the command as written since I can't actually
> enter those keys on my keyboard.

Yes, Eric, you are right. The cyrillic command names are not supported
as Vim types: "Invalid command name" after I try to define such a
command. (I use utf-8 encoding.)

So, Vim does not fully support utf-8 and thus using commands instead of
abbreviations is not an option for me.

> You could use a mapping instead of a command pretty easily.

Not so easy as one can think as

1. I just cannot type mapping quick enough for it to work if
1) the mapping is more than 4 characters long,
2) I use it not very often and thus stop in the middle
of it to recall the next character.
2. I cannot use for mappings such combination of letters
that can be encountered in usual text. That results in
a longer and harder to remember mappings and the latter
magnifies the reason 1 above.

As to abbreviations, they have their own limitations.

First of all, they cannot contain cyrillic letter "р"
at least in utf-8 encoding and at least for now. (Well,
actually they can but in this case they just do not
expand.)

Second, they do not expand if typed just after other
letter characters.

> Does it need to be a command?

Yes, this alternative to mappings and abbreviations
would be very attractive (if they can work with
cyrillic command names, of course) as in addition
they could use arguments, for example, to insert
some changeable numbers in the middle of a
non-changeable text.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment