Re: "iabbrev" erratic behaviour

Gary Johnson <[email protected]>
Newsgroups gmane.editors.vim
Message-ID <20240220054824.GH26982@phoenix>
On 2024-02-19, Maxim Kim wrote:

> On Monday, February 19, 2024 at 11:29:19 PM UTC+11 Ottavio Caruso wrote:
> > 
> > Hi,
> > 
> > I have this is in my .vimrc:
> > 
> > iabbrev mdate <C-R>=strftime("%a %d/%m/%Y")
> > 
> > 
> > It used to work fine, but as of recently (3 or 4 weeks or so), this
> > abbreviation only works if it is the first thing that I input on any
> > file. If I edit a file, type some characters and then I type "mdate",
> > it doesn't get expanded. I have to save and exit the file, then
> > re-open it and then type "mdate".
> > 
> > Is there a way to troubleshoot that?
> 
> You can check if it works without your configuration: 
> 
> $ vim -Nu NONE
> : iabbrev mdate <C-R>=strftime("%a %d/%m/%Y")<CR>
> 
> If it isthere must be something in vim config you will need to figure out. One
> common approach is to bisect your vimrc.

Also, you can start vim like this:

    $ vim --noplugin

which will use your vimrc but not your plugins.  If your
abbreviation works then, it's _probably_ a plugin and not your
vimrc.

To see which plugins are loaded, use this:

    :scriptnames

If it appears to be a plugin that's causing the problem, you can
bisect your list of plugins by moving some of them elsewhere
temporarily.

Since the problem started 3 or 4 weeks ago, it's likely due to
something you changed 3 or 4 weeks ago.  This command might help in
spotting a change you made at that time.

    $ find ~/.vim -type f -mtime +21 -mtime -35 | xargs ls -lt

That will find all regular files (-type f) with modification times
(-mtime) greater than 3 weeks ago (+21) and less than 5 weeks ago
(-35) and list them, sorted by modification time.

>>     A: Because it messes up the order in which people normally read text.
>>     Q: Why is top-posting such a bad thing?
>>     A: Top-posting.
>>     Q: What is the most annoying thing in e-mail?

B-)

Regards,
Gary

-- 
-- 
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 [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20240220054824.GH26982%40phoenix.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.