On Monday, September 29, 2014 1:21:57 AM UTC-5, gevisz wrote:
> 
> 
> So, Vim does not fully support utf-8 and thus using commands instead of
> 
> abbreviations is not an option for me.  
> 
> 
Nope I guess not. But abbreviations don't work in normal mode anyway which is where you wanted to use your command.
> 
> > 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.
> 
You could set your 'timeoutlen' to be longer if you like.
> 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. 
> 
> 
In normal mode, where you wanted to create your command, you will never be inserting text. So this reason doesn't apply.
> 
> 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.)
> 
> 
That is a bug. It will be fixed.
> 
> Second, they do not expand if typed just after other
> 
> letter characters.
> 
> 
By this, do you mean that your abbreviation must have whitespace preceding? Or something else?
> 
> > 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.
That could also be accomplished with a mapping, using getchar() or input() or something within the mapping. Especially if you use an <expr> mapping.
But all in all...it sounds like maybe you need a snippet plugin of some sort. Do a web search, there are several.
As a different approach, maybe you can look into using insert-mode completion instead of mappings or abbreviations. If you're only completing single words (separated by "non-keyword" characters) then you could potentially use dictionary completion (:help 'dictionary', :help compl-dictionary). If you have phrases also to complete, then you can define a user-completion (:help compl-function) or omni-completion (:help compl-omni) function to insert whatever you want based on whatever input you want. If you have several similar entries, you can see them all in a list. You could even parse "arguments" of sorts in your completion function for text that can change.
-- 
-- 
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.
Monday, September 29, 2014
Subscribe to:
Post Comments (Atom)
 
No comments:
Post a Comment