On 21-May-2011 Radek <[email protected]> wrote:
> Hi there,
>
> I didn't like how the current highlighting for shell scripts behaved in
> certain situations, so I wrote my own syntax file. It supports
> POSIX-compliant (POSIX.1-2008) shell scripts and Bash (4.2.10).
>
> It's designed to be more syntax-driven than the current one (e.g. it
> does not highlight every keyword it finds as a command name - only
> those that are actual command names). As a side effect, it can catch
> many invalid constructs and highlight them as errors.
The following fragments in my scripts get highlighted as errors:
#v+
#!/bin/bash
if [[ "$1" = "--offset" ]] ; then
true
elif [[ "$1" =~ --offset=(.*) ]] ; then
false
else
true;
false;
fi
#v-
(parentheses and the following space).
#v+
#!/bin/bash
for(( ; $# > 0; ))
do
true
done
#v-
(beginning with '$#' up to 'done').
#v+
#!/usr/bin/env bash
original=$6
modified=${original%.svn-base}
modified=${modified/\/.svn\/text-base/}
#v-
('\/.svn\/text-base/').
What's strange is that sometimes the last one gets highlighted
correctly. It suffices to execute "setf sh" once again.
--
Cheers,
Lech
--
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