I have consulted Vim's documentation and found the section on
ft-sh-indent to be confusing. The documenation found on the Web is the
same as what I have locally.
<http://vimdoc.sourceforge.net/htmldoc/indent.html#ft-sh-indent>
I have tried setting the documented values in
'~/.vim/after/indent/sh.vim' as well as setting values manually with
a shell file loaded. Both result in undefined variable error when
trying to set dictionary keys.
I have looked in '/usr/share/vim/vim72/indent/sh.vim' and have not found
any references to the variables documented.
I am running Vim 7.2 on Ubuntu 9.04 and have filetype detection, plugin,
and indent enabled.
What aspect of the indentation are you trying to control? What
variables are you trying to set, how exactly are you trying to set
them, and what exactly happens when you try?
Regards,
Gary
Have a look at the documentation. There seems to be conflicting or at
least confusing information whether it is b:sh_indent_defaults or
b:sh_indent_options.
> What aspect of the indentation are you trying to control? What
> variables are you trying to set, how exactly are you trying to set
> them, and what exactly happens when you try?
I want to change the indent of case statements. Trying to set any of
the documented dictionary keys results in the same error message. For
example:
:let b:sh_indent_options['case-labels'] = 0
Results in:
E121: Undefined variable: b:sh_indent_options
Anyway, this may be a wild goose chase since sh_indent_options nor
sh_indent_defaults is referenced in none of the installed plugins. As
a comparison, look at the documentaton for Python indent.
<http://vimdoc.sourceforge.net/htmldoc/indent.html#ft-python-indent>
The documented variables can be found in the python.vim indent plugin.
What aspect of the indentation are you trying to control? What
variables are you trying to set, how exactly are you trying to set
them, and what exactly happens when you try?
Regards,
Gary
OK, I see the problem now. The most recent version of vim I have is
7.2.264 and it still came packaged (for Cygwin) with indent/sh.vim
revision 2006-04-19, which uses neither b:sh_indent_defaults nor
b:sh_indent_options. The vim-7.2.184 for Windows that I got from
the Cream project also has the old indent/sh.vim. Yet, ":help
ft-sh-indent" for all the versions of vim I have describe
b:sh_indent_options.
The problem is that the latest official release of vim is 7.2 with
no patches. It is up to anyone building a patched version to
download and apply the patches themselves. The patches, however, do
not include any updates to the runtime files, so one has to also
download and install the latest runtime files. That apparently
wasn't done by the folks distributing the vim packages that you and
I have. That, or the new indent/sh.vim didn't make it into the
runtime repository.
I've been lax in keeping the vim installations I build myself up to
date, so I don't know whether the runtime repository currently has
the new indent/sh.vim or not.
There is definitely an error in the current help documentation as
well, but I don't know whether the correct name for the dictionary
is sh_indent_defaults or sh_indent_options.
To find out how to download the latest runtime files, see
http://vim.sourceforge.net/runtime.php
Regards,
Gary
Vim 7.2.79 here and same revision of 'indent/sh.vim'.
> The problem is that the latest official release of vim is 7.2 with
> no patches. It is up to anyone building a patched version to
> download and apply the patches themselves. The patches, however, do
> not include any updates to the runtime files, so one has to also
> download and install the latest runtime files. That apparently
> wasn't done by the folks distributing the vim packages that you and
> I have. That, or the new indent/sh.vim didn't make it into the
> runtime repository.
Would this be a packaging bug?
> I've been lax in keeping the vim installations I build myself up to
> date, so I don't know whether the runtime repository currently has
> the new indent/sh.vim or not.
OK, seems the new 'indent/sh.vim' isn't in the runtime repository. It
is the same revision I already had installed -- 2006-04-19.
> There is definitely an error in the current help documentation as
> well, but I don't know whether the correct name for the dictionary
> is sh_indent_defaults or sh_indent_options.
Should I file a bug report on it?
> To find out how to download the latest runtime files, see
>
> http://vim.sourceforge.net/runtime.php
Thanks for your help.
> > The problem is that the latest official release of vim is 7.2 with
> > no patches. It is up to anyone building a patched version to
> > download and apply the patches themselves. The patches, however, do
> > not include any updates to the runtime files, so one has to also
> > download and install the latest runtime files. That apparently
> > wasn't done by the folks distributing the vim packages that you and
> > I have. That, or the new indent/sh.vim didn't make it into the
> > runtime repository.
>
> Would this be a packaging bug?
It's a bug somewhere. If, as you say below, the runtime repository
doesn't contain the version of a plugin that matches the latest
documentation, then there will be an error in the package but it
won't be the fault of the packager.
> > I've been lax in keeping the vim installations I build myself up to
> > date, so I don't know whether the runtime repository currently has
> > the new indent/sh.vim or not.
>
> OK, seems the new 'indent/sh.vim' isn't in the runtime repository. It
> is the same revision I already had installed -- 2006-04-19.
>
> > There is definitely an error in the current help documentation as
> > well, but I don't know whether the correct name for the dictionary
> > is sh_indent_defaults or sh_indent_options.
>
> Should I file a bug report on it?
I think you should file reports on both bugs.
> Thanks for your help.
You're welcome.
Regards,
Gary
It's an upstream problem, for sure.
ftp://ftp.vim.org/ftp/pub/vim/runtime/doc/indent.txt mentions
sh_indent_options and sh_indent defaults
ftp://ftp.vim.org/ftp/pub/vim/runtime/indent/sh.vim uses neither.
Since those are the latest runtime files from FTP in both cases, the
docs definitely don't match up with the indent script.
~Matt