On Tue, 24 May 2011 07:23:08 -0700
Gary Johnson <[email protected]> wrote:

> The current $VIMRUNTIME/syntax/sh.vim also has bash-specific and
> even ksh-specific constructs, so the name is consistent with current
> practice.  On the other hand, if this sh.vim is to replace
> $VIMRUNTIME/syntax/sh.vim, it should also support ksh constructs.

Basically you're right. If Vim doesn't detect a file as a Bash script,
my syntax defaults to POSIX-compliance mode. If Vim determines a file
to be a Bash script (e.g. its first line is "#!/bin/bash"), or if the
user has g:is_bash variable set, then (and only then) Bash-specific
constructs are enabled. If you use some ancient shells that don't
support POSIX features, it wouldn't be too hard for me to make the
default bare bones, without e.g. "${var##prefix}" or "$(...)" command
substitution and enable full POSIX only on certain conditions.

I don't use ksh, but I know that some parts of POSIX as well as many
Bash features were inspired by ksh, so it's likely that making this
syntax ksh-compatible will be fairly easy. I would be honored if my
sh.vim made it into the official Vim distribution, so I can look into
it ;)

-- 
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

Raspunde prin e-mail lui