On 2009-11-09, James Michael Fultz wrote:
> * Gary Johnson <[email protected]> [2009-11-09 09:42 -0800]:
> >
> > On 2009-11-09, James Michael Fultz wrote:
> > > How do I control the indentation in shell scripts when using the
> > > filetype indent plugin?
> > >
> > > 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>
>
> 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.
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
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---