Benjamin R. Haskell wrote:
> On Tue, 12 Oct 2010, Bee wrote:
>
> > Benjamin R. Haskell wrote:
> >> On Tue, 12 Oct 2010, Bee wrote:
> >>
> >>> What keeps clearing my spellcapcheck?
> >>
> >> What does this return?
> >>
> >> :verbose set spellcapcheck?
> >
> > In the first buffer opened it returns:
> > spellcapcheck=[.?!]\_[\])'"^I ]\+
> >
> > When switching to another buffer:
> > spellcapcheck=
>
> Doesn't it state where it was last set at that point (after something
> has changed it?
>
>
> > What would cause it to be cleared on buffer switch?
> > Both files are the same type xxx.txt
> > Each opened by itself spellcapcheck is ok!
>
> Sounds like you have an autocmd that is overriding spellcapcheck.
> Running the following script might help find it: (Have wanted to write
> something like this for a while -- next step would be to expand function
> calls found in the autocmds).
>
> ===> ~/.vim/plugin/find-auto.vim <===
> " Find autocmds that set certain parameters
> fun! FindAutocmdTouching(...)
> " capture the text of existing autocmds
> redir => aucmds
> silent! au
> redir END
> let found = {}
> let evt = 'unknown'
> for line in split(aucmds, '\n')
> " lines starting with non-whitespace are event names
> if line =~ '^\S'
> let evt = line
> continue
> endif
> " add an entry if the line matches any of the passed patterns
> if len(filter(copy(a:000), 'line =~ v:val'))
> let found[evt] = get(found, evt, []) + [line]
> endif
> endfor
>
> " print a small report of what was found
> if len(found)
> for [k, v] in items(found)
> echo "autocmd" k
> for line in v
> echo line
> endfor
> endfor
> else
> echo "None found"
> endif
> endfun
>
> " check for the two variants of 'spellcapcheck'
> call FindAutocmdTouching('spellcapcheck','spc')
I put this function in a file and then
:so find-auto.vim
Result:
None found
Is that the correct way to use it?
-Bill
--
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