Instaling Shellcheck and other syntax checking plug-ins in vim

652 views
Skip to first unread message

"Cedric Bhihe (毕生泰)"

unread,
Aug 14, 2015, 12:04:19 AM8/14/15
to vim...@googlegroups.com
Hello - my first post in this list.

I use vim version 7.4 (2013 Aug 10, compiled Jan  2 2014 19:39:47), 'huge' version with GTK2-GNOME GUI, on Gnome terminal and run an Ubuntu 14.04.3 LTS Desktop on my box.

I use vim to script, to write Python, C and previously Fortran 77 programs. I want to use shellcheck, static analysis for sh and bash, locally (i.e. not online).

I am confused as to how to proceed for the install of shellcheck and other plug-ins in vim..
I need pointers and advice as to how I should go about it. So far I "sort of" gathered that:

1) shellcheck can be used in a terminal front-end of its own when downloaded from https://github.com/koalaman/shellcheck.
If I understand correctly what that implies, beside the fact that it means compiling with all necessary Haskell libraries (no thanks!), I would not want that. Instead I want to keep using Gnome-terminal while using vim and add-on modules and features.

2) it can be run in my editor. Quoting from http://www.shellcheck.net/about.html :
" ShellCheck can output gcc style error messages and checkstyle compatible xml, which allows any editor to show in-lined error messages. It's also supported directly by the vim plug-in  Syntastic in Vim."

Since Syntastic also has syntax checking plug-ins for C, C++ and Python, it probably is the right solution for me. I checked that my vim install  features: autocmd, eval, file_in_path, modify_fname, quickfix, reltime, and user_commands, apparently a prerequisite for syntastic. The Russian puppets game never ends and I discovered than syntastic works best with a plug-in manager called pathogen.vim.

Following those instruction I installed Pathogen and Syntastic.

Q-1: Instead of consulting Syntastic's help within vim (:help syntastic) with only 23 lines of scrolling text in terminal is there an online html doc I can look at ? (I want to improve on default Syntastic settings in my ~/.vimrc file.)

Q-2: How do I install shellcheck for sh / bash and whatever checkers there are for Python, C and C++ ?

Thank you beforehand for your help.

-cedric
GMT+1

LCD 47

unread,
Aug 15, 2015, 1:27:00 PM8/15/15
to vim...@googlegroups.com
On 13 August 2015, "Cedric Bhihe (毕生泰)" <cedric...@gmail.com>
wrote:
[...]
> *Q-1*: Instead of consulting Syntastic's help within vim (:help
> syntastic) with only 23 lines of scrolling text in terminal is there
> an online html doc I can look at ? (I want to improve on default
> Syntastic settings in my ~/.vimrc file.)
[...]

If installing syntastic like a Russian puppet and you have a problem
with reading the help, then you can safely give up right away, syntastic
is not for you.

/lcd

"Cedric Bhihe (毕生泰)"

unread,
Aug 15, 2015, 4:47:20 PM8/15/15
to vim...@googlegroups.com
Hello @lcd047:
Thank you for your reply. I gather from it that you have nothing to offer
that could remotely look like an answer to my simple query.
I also think that you may well have misunderstood my message as well as
the purpose of this list. Please stay constructive. Cheers.
-ced
GMT+1

Nelo-Thara Wallus

unread,
Sep 2, 2015, 1:18:29 PM9/2/15
to vim...@googlegroups.com
On 08-13/10:40, "Cedric Bhihe (毕生泰)" wrote:
> Hello - my first post in this list.
>
> [...]
>
> I am confused as to how to proceed for the install of _/shellcheck/_ and
> other plug-ins in vim..
> I need pointers and advice as to how I should go about it. So far I /"sort
> of/" gathered that:

Use a plugin manager like vim-plug[1]. Those take care of everything for you,
you only need to have your vimrc available.

>
> 1) _/shellcheck/_ can be used in a terminal front-end of its own when
> downloaded from https://github.com/koalaman/shellcheck.
> If I understand correctly what that implies, beside the fact that it means
> compiling with all necessary Haskell libraries (no thanks!), I would not
> want that. Instead I want to keep using Gnome-terminal while using vim and
> add-on modules and features.
>
> 2) it can be run in my editor. Quoting from
> http://www.shellcheck.net/about.html :
> /" ShellCheck can output gcc style error messages and checkstyle compatible
> xml, which allows any editor to show in-lined error messages. It's also
> supported directly by the vim plug-in //Syntastic
> <https://github.com/scrooloose/syntastic>//in Vim//."/

Bit of advice - shellcheck is nice for the beginning, but once you wrote your
first few scripts it'll just annoy you with false-positive findings.

> [...]

Cheers,
Nelo

[1]: https://github.com/junegunn/vim-plug

--
Viktoriastrasse 22
76133 Karlsruhe
Nr.: 0721 / 96 55 63 95
Handy: 0178 / 53 17 067
/"\ ASCII Ribbon Campaign
\ / - against HTML emails
X - against proprietory attachments
/ \ http://en.wikipedia.org/wiki/ASCII_Ribbon_Campaign

Cedric Bhihe (毕生泰)

unread,
Sep 2, 2015, 2:24:18 PM9/2/15
to vim...@googlegroups.com
Hi Nelo-Thara Wallus and thanks for the heads-up.

I am not a beginner in matters of shell scripting and I am already noticing
what you are warning against.

Is there any way I can temporarily disable a plugin, within a vim session ?

(FYI, I ended up installing it with `syntastic`.)

Cheers,
-cedric



Reply all
Reply to author
Forward
0 new messages