From: Gary Johnson <garyj...@spocom.com>
Date: Thu, 27 Sep 2012 23:01:46 -0700
Local: Fri, Sep 28 2012 2:01 am
Subject: Re: Does b:undo_ftplugin actually work?
On 2012-09-27, ZyX wrote:
Thanks for the reply, but I see that I didn't explain the problem
> пятница, 28 сентября 2012 г., 8:04:05 UTC+4 пользователь Gary Johnson написал: > > I was working on some code that set b:undo_ftplugin, but it didn't > > have any effect when I set a new filetype. I copied > > $VIMRUNTIME/ftplugin.vim to ~/.vim and instrumented the section that > > is supposed to execute b:undo_ftplugin. > > func! s:LoadFTPlugin()
> > Whenever I open a new file for which Vim can detect the filetype, or
> > Error detected while processing function <SNR>5_LoadFTPlugin:
> > That is even after I execute
> > :echo b:undo_ftplugin
> > and verify that it is set correctly according to the new filetype.
> > It seems that b:undo_ftplugin does not exist in the environment in
very well. Also, some of my experiments created new buffers instead of replacing the contents of existing buffers with new filetypes, so I wasn't replicating the actual problem conditions. Let me try again.
The actual problem is that I would like to set 'indentexpr' for
au BufWinEnter * if &ft == "" || &ft == "text"
When I start vim and execute
:echo b:undo_ftplugin
I see
setl inde< indk<
as expected. Further, ":ls" shows
1 %a "[No Name]" line 1
Now, if I open a C file, I expect to have 'indentexpr' empty, either
:e foo.c
I see
indentexpr=indent(prevnonblank(v:lnum-1))
and ":ls" shows
1 %a "foo.c" line 1
I did take your advice about using echom and instrumented
If ":edit wipes the buffer" as you say, so that b:undo_ftplugin is
I'm just looking for a way to reset those local options when I edit
Not using :edit is not a solution. For example, if I start vim
Regards,
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||