Thursday, April 28, 2016

Re: Bash syntax highlighting inconsistent

* Eric Pruitt <eric.pruitt@gmail.com> [2016-04-28 06:13]:
> It's highlighted incorrectly on the Debian 8 machine but not the RedHat
> 6 machine. I am running the exact same version of Vim on both machines
> (7.4 patch level 1796) with the exact same set of configuration files.
> If I run ":scriptnames" on both hosts, the text is identical. Does
> anyone have any ideas what's up with the difference in syntax
> highlighting?

The reason of this behavior is that /bin/sh on these two systems is
a symbolic link. On Debian it points to dash and on Red Hat it points
to bash.

These two shells have slightly different syntax. For example bash
allows you to use reserved word function in function declaration while
dash does not. Vim supports syntax highlighting for these and some
other shells.

Among the other things Vim resolves /bin/sh to determine which shell
type is in use. To force bash syntax you can append filename with .bash
suffix or specify bash in shebang explicitly.

Read :help sh.vim for more information.

--
Dmitri Vereshchagin

--
--
You received this message from the "vim_use" 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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: