Sunday, July 31, 2011

Re: sh vs bash syntax coloring

On 2011-07-31, ranousse wrote:

> By the way I have another question concerning shell and vim.
> I'm using zsh as interactive shell (because of completion possibilities)
> but I prefer bash/sh to write scripts.
>
> So when I type
> :!shell_command
> I would prefer it was seen as bash code by vim
> and when I type
> :sh
> I would prefer vim opens zsh as interactive shell.

I'm not sure I understand the problem. If you write your shell
scripts with

#!/bin/bash

as the first line, they will be executed by bash, regardless of the
shell they were started from.

What behavior do you want from

:!shell_command

that you get from bash that you don't get from zsh?

> I know I can do
> :set sh=bash
> but it changes shell in both case.

You could create a ~/.bashrc that contains just

exec /bin/zsh

and that would start zsh as your interactive shell, but I don't know
whether the behavior would be the same as if you executed ":sh" with
sh=zsh.

Regards,
Gary

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

No comments: