Wrong vim color syntax

146 views
Skip to first unread message

Willem D'Haese

unread,
Jul 6, 2016, 9:41:35 PM7/6/16
to vim_use
Hello,

There seems something wrong with the coloring in this code with VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jun 10 2014 06:55:55)?

cat <<EOF>/etc/yum.repos.d/influxdb.repo
[influxdb]
name = InfluxDB Repository - CentOS \$releasever
baseurl = https://repos.influxdata.com/centos/\$releasever/\$basearch/stable
enabled = 1
gpgcheck = 1
gpgkey = https://repos.influxdata.com/influxdb.key
EOF

WriteLog Output Info "Tick - Installing influxdb"
yum install influxdb -y

git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt

WriteLog Output Info "Tick Build End"

Grtz

Willem
vim.PNG

Christian Brabandt

unread,
Jul 7, 2016, 1:20:22 AM7/7/16
to vim...@googlegroups.com
Missing information here. What syntax/filetype is this? Please first try
to
get a newer syntax file (perhaps from the repository from the maintainer
or
you might try the included runtime file from a later vim version)

If that does not help, please contact the maintainer of the file
(address is given in the header of the file) and discuss the issue with
him.
It looks like the syntax script does not handle here documents.

Best,
Christian

Willem D'Haese

unread,
Jul 14, 2016, 11:03:47 AM7/14/16
to vim_use

Hello Christian,

Thanks for the help. It is actually a Bash script with filename FireTIG (without .sh extension) I made myself. Where can I find the syntax file for Bash?

Grtz

Charles E Campbell

unread,
Jul 14, 2016, 2:56:44 PM7/14/16
to vim...@googlegroups.com
Please try the syntax files for sh.vim available at:
http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH (v154).

Regards,
Chip Campbell

Richard Mitchell

unread,
Jul 14, 2016, 4:24:46 PM7/14/16
to vim_use

As a pointless programming tip, I put the proper extension on my script code files (.sh, .pl, etc) and then use make to copy&strip the extension/chmod them into a bin area. While this seems unnecessary, besides making it easier for vim know how to colorize the code, it also allows the use of find/grep for searching.

Willem D'Haese

unread,
Jul 15, 2016, 7:54:02 AM7/15/16
to vim_use
Thanks Chip, updating sh.vim seems to have solved the issue. Just an informative question, is this something that will get fixed in the vim yum package? Or do I have to patch sh.vim myself on my systems?

Willem
https://outsideit.net

Charles E Campbell

unread,
Jul 15, 2016, 11:37:52 AM7/15/16
to vim...@googlegroups.com
Willem D'Haese wrote:
> Thanks Chip, updating sh.vim seems to have solved the issue. Just an informative question, is this something that will get fixed in the vim yum package? Or do I have to patch sh.vim myself on my systems?
>
Eventually I will send the file on to Bram for inclusion. I leave it on
my website for awhile for comment/testing before I send it out.

Regards,
Chip Campbell

Nikolay Aleksandrovich Pavlov

unread,
Jul 15, 2016, 3:13:00 PM7/15/16
to vim...@googlegroups.com
I find omitting extensions for somebody’s own non-published scripts
completely useless. Most of time I in any case use tab completion to
finish script name, so it is not going to save typing time. But as it
is uncommon for third-party executables to have an extension (it is
also the reason why there is no extension on many of my published
scripts) it is less likely that your script with extension happen to
share a name with something you recently installed.

>
> --
> --
> 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+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Willem D'Haese

unread,
Aug 11, 2016, 3:42:38 PM8/11/16
to vim_use
Richard, ZyX,

FireTIG is just one part of a whole set of scripts built around monitoring and automation. All those scripts start with Fire, for example:
- FireCentOS
- FireRunDeck
- FireMotD
- FireRenewal
- FireSnapshot
- FireTIG
- FireConf
- FireBerry
- FireNagios

I choose this several years ago. If I had to change all this, it would take me a lot of time. FireMotD is the only one I made public on GitHub.
https://github.com/willemdh/FireMotD

(Just trying to explain how I came to this)

Grtz and tx for the input all.

Willem

Willem D'Haese

unread,
Aug 11, 2016, 4:00:07 PM8/11/16
to vim_use
Just noticed (with the latest syntax file) another color issue.
Starting after MemFree the colors are incorrect. See attached screenshot. This is with the vim.sh version 154 from Jul 07, 2016

Why Does it say ASTRO-ONLY by the way?

Grtz


FireMotD.PNG

Charles E Campbell

unread,
Aug 11, 2016, 4:05:49 PM8/11/16
to vim...@googlegroups.com
Please send me the text; I don't have the time to type in all that
stuff, and I'll need to work with it. As far as "ASTRO-ONLY" goes --
see http://www.drchip.org/astronaut/vim/index.html#VimFuncs where it
discusses my plugins' "release states".
My sending it to the mailing list was a mistake on my part.

Chip Campbell

Willem D'Haese

unread,
Sep 2, 2016, 2:15:13 PM9/2/16
to vim_use
Hello,

You can find the text here: https://raw.githubusercontent.com/willemdh/FireMotD/master/FireMotD

Problem seems to start at line 211, maybe related to the '<<<'?

MemFreeB="$(cat /proc/meminfo | grep MemFree | awk {'print $2'})"
MemTotalB="$(cat /proc/meminfo | grep MemTotal | awk {'print $2'})"
MemUsedB="$(expr $MemTotalB - $MemFreeB)"
MemFree="$(printf "%0.2f\n" $(bc -q <<< scale=2\;$MemFreeB/1024/1024))"
WriteLog Verbose Info "MemFree: $MemFree"
MemUsed="$(printf "%0.2f\n" $(bc -q <<< scale=2\;$MemUsedB/1024/1024))"
WriteLog Verbose Info "MemUsed: $MemUsed"
MemTotal="$(printf "%0.2f\n" $(bc -q <<< scale=2\;$MemTotalB/1024/1024))"
WriteLog Verbose Info "MemTotal: $MemTotal"


Grtz and tx

Willem

Charles E Campbell

unread,
Sep 7, 2016, 12:36:41 AM9/7/16
to vim...@googlegroups.com
Please try syntax/sh.vim v162 which you may get from my website:
http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH . I didn't see
any problem -- of course, that may be due to the fact that its 12:34am
here and I'm about to fall asleep.

Regards,
Chip Campbell

Willem D'Haese

unread,
Nov 21, 2016, 4:02:45 PM11/21/16
to vim_use
Chip,

Sorry for the very late answer, having an extremely busy time here. But good news, I just downloaded the latest version 165 of sh.vim and the syntax coloring issue I was created this thread for is solved.
People can now vim my FireMotD (https://github.com/willemdh/FireMotD) with full color syntax. :)

Thanks a lot.

Willem
https://outsideit.net

Reply all
Reply to author
Forward
0 new messages