> I found a strange behavior in vim 7.3.146 when adding insert-mode
> abbreviations with the tex syntax loaded. Given a test.tex file that
> contains just one line
>
> \begin{article}
>
> The following command gives error "E474: Invalid argument":
>
> vim -N -i NONE -u NONE -c "syntax on" -c "iabbrev 0foo bar"
> test.tex
>
> The result is the same if the "syntax on" and "iabbrev 0foo bar"
> commands
> are typed within the vim session. Somehow vim does not like any
> abbreviations
> that start with a digit.
The $VIMRUNTIME/syntax/tex.vim script changes the value of the
"iskeyword" option, that's probably the reason you're seeing this
behavior. Here's the relevant part from the script:
" (La)TeX keywords: only use the letters a-zA-Z {{{1
" but _ is the only one that causes problems.
if version < 600
set isk=a-z,A-Z
if b:tex_stylish
set isk+=@
endif
else
setlocal isk=a-z,A-Z
if b:tex_stylish
setlocal isk+=@
endif
endif
You can try to reset the "iskeyword" option after loading the syntax
script to see if that fixes the problem with the following command:
:set iskeyword&vim
- Peter Odding
PS. I've never liked how "iskeyword" is overloaded to have twenty
different meanings; this has bitten me numerous times :-(
--
You received this message from the "vim_dev" 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