New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

syntastic error when using vi #2701

Closed
fibo opened this Issue Jan 29, 2016 · 7 comments

Comments

Projects
None yet
3 participants
@fibo

fibo commented Jan 29, 2016

Hi all,

I started using fish shell yesterday. I wrote an article about it, as you can read in the Cons section

when I launch vi, I got an error message from syntastic

syntastic: error: your shell /usr/local/bin/fish can't handle traditional UNIX syntax for redirections

while if I use vim I get no warning. Maybe I am missing something? Do you suggest I create a function to alias vi with vim?

@faho

This comment has been minimized.

Show comment
Hide comment
@faho

faho Jan 29, 2016

Member

I'm assuming your vi isn't actually vi but another vim. Is that correct?

What you need to do is set shell=/bin/bash before syntastic tries to execute shell scripts, and it seems that happens when launched as vim but not as vi.

There's a bit in the syntastic docs, which also tell you that you could also set a special syntastic variable, but since more vim-plugins exhibit this issue, you are probably better off setting the general variable. (Also we do support "traditional UNIX syntax for redirections" - that claim's at least outdated)

Member

faho commented Jan 29, 2016

I'm assuming your vi isn't actually vi but another vim. Is that correct?

What you need to do is set shell=/bin/bash before syntastic tries to execute shell scripts, and it seems that happens when launched as vim but not as vi.

There's a bit in the syntastic docs, which also tell you that you could also set a special syntastic variable, but since more vim-plugins exhibit this issue, you are probably better off setting the general variable. (Also we do support "traditional UNIX syntax for redirections" - that claim's at least outdated)

@pickfire

This comment has been minimized.

Show comment
Hide comment
@pickfire

pickfire Jan 29, 2016

Contributor

@fibo, vim and neovim have this issue, just set shell=/bin/bash.

https://github.com/junegunn/vim-plug/wiki/faq#errors-on-fish-shell have some documentation for this too, I have saw some troubleshooting for this everywhere, I just hope that we could use fish's wiki for this.

Contributor

pickfire commented Jan 29, 2016

@fibo, vim and neovim have this issue, just set shell=/bin/bash.

https://github.com/junegunn/vim-plug/wiki/faq#errors-on-fish-shell have some documentation for this too, I have saw some troubleshooting for this everywhere, I just hope that we could use fish's wiki for this.

@fibo

This comment has been minimized.

Show comment
Hide comment
@fibo

fibo Jan 29, 2016

Actually my vi is the OSX default (/usr/bin/vim) which is version 7.3, while my vim is installed by brew and located ad /usr/local/bin/vim and has version 7.4: by the way I added to my .vimrc the line

let g:syntastic_shell = "/bin/sh"

and now also with vi (version 7.3) works. Btw I opened an issue to update syntastic doc: vim-syntastic/syntastic#1681

fibo commented Jan 29, 2016

Actually my vi is the OSX default (/usr/bin/vim) which is version 7.3, while my vim is installed by brew and located ad /usr/local/bin/vim and has version 7.4: by the way I added to my .vimrc the line

let g:syntastic_shell = "/bin/sh"

and now also with vi (version 7.3) works. Btw I opened an issue to update syntastic doc: vim-syntastic/syntastic#1681

@pickfire

This comment has been minimized.

Show comment
Hide comment
@pickfire

pickfire Jan 29, 2016

Contributor

@fibo I suggest to use:

set shell=/bin/sh

Well, other plugins could be broken too.

Contributor

pickfire commented Jan 29, 2016

@fibo I suggest to use:

set shell=/bin/sh

Well, other plugins could be broken too.

@fibo

This comment has been minimized.

Show comment
Hide comment
@fibo

fibo Jan 29, 2016

do you mean to add it in the config.fish?

fibo commented Jan 29, 2016

do you mean to add it in the config.fish?

@faho

This comment has been minimized.

Show comment
Hide comment
@faho

faho Jan 29, 2016

Member

No, in vimrc - fish syntax wouldn't have the "=". This is the general variable for a shell, while syntastic_shell is just for syntastic, but will by default use the value of shell, so just setting shell should work for syntastic and everything else.

Member

faho commented Jan 29, 2016

No, in vimrc - fish syntax wouldn't have the "=". This is the general variable for a shell, while syntastic_shell is just for syntastic, but will by default use the value of shell, so just setting shell should work for syntastic and everything else.

fibo added a commit to fibo/home that referenced this issue Jan 29, 2016

@fibo

This comment has been minimized.

Show comment
Hide comment
@fibo

fibo Jan 29, 2016

Yes I got it, something like this https://github.com/fibo/home/blob/home/.vimrc#L11

it should be added before loading plugins I guess.

It works, I updated my article linked above, and yes: this tip should be suggested to all fish shell newbies like me.

fibo commented Jan 29, 2016

Yes I got it, something like this https://github.com/fibo/home/blob/home/.vimrc#L11

it should be added before loading plugins I guess.

It works, I updated my article linked above, and yes: this tip should be suggested to all fish shell newbies like me.

@fibo fibo closed this Jan 29, 2016

@faho faho added the question label Jan 29, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment