Who maintains cobol.vim?

229 views
Skip to first unread message

John Culleton

unread,
Feb 10, 2015, 11:59:34 AM2/10/15
to vim...@googlegroups.com
There is an annoying error in cobol.vim when used
with the traditional layout (i.e. first 6 columns
reserved for a line number and all statements in
upper case.) The occurrence of the IF verb causes
the statement containing it to be red highlighted
as a syntax error.

As a result I have to turn off syntax
highlighting to read the IF statements easily.

I don't know enough about the intricacies of
syntax files to correct this error. I have added
the IF word to the list of reserved words but I
doubt that will solve the problem. In any case
cobol.vim should be fixed for all users. Rather
than trying to chase down the maintainer myself
I thought I would ask here.

Maybe there isn't a current maintainer (gloomy
thought.)
--
John Culleton
Wexford Press
Free list of books for self-publishers:
http://wexfordpress.net/shortlist.html
Updated PDF e-book: "Create Book Covers with
Scribus 1.4.5" coming soon at
http://www.booklocker.com/!

Andrew Long

unread,
Feb 10, 2015, 12:58:19 PM2/10/15
to vim...@googlegroups.com
On 10 Feb 2015, at 15:57, John Culleton wrote:
> There is an annoying error in cobol.vim when used
> with the traditional layout (i.e. first 6 columns
> reserved for a line number and all statements in
> upper case.) The occurrence of the IF verb causes
> the statement containing it to be red highlighted
> as a syntax error.

This may be irrelevant, but...

I've had problems with COBOL.vim if smarttabs are switched on, after starting a new line. The problem is that the smart tabs don't count properly towards working out the column settings and so it highlights what *looks* like it ought to be a valid line as invalid. I got around this by switching off smart tabs in the ftdetect.vim script

If it's this problem you should be able to find out by looking for hard tab characters where there ought to be single space characters?

Regards, Andy


--
Andrew Long
Andrew dot Long at Mac dot com


signature.asc

Gary Johnson

unread,
Feb 10, 2015, 1:03:45 PM2/10/15
to vim...@googlegroups.com
On 2015-02-10, John Culleton wrote:

> In any case cobol.vim should be fixed for all users. Rather than
> trying to chase down the maintainer myself I thought I would ask
> here.
>
> Maybe there isn't a current maintainer (gloomy thought.)

Tim Pope didn't respond to e-mail? His address is at the top of
$VIMRUNTIME/syntax/cobol.vim.

Regards,
Gary

John Culleton

unread,
Feb 10, 2015, 2:19:38 PM2/10/15
to vim...@googlegroups.com
Can't find ftdetect.vim script. Is there a better
spelling of the name?

Stay warm,

John Culleton

unread,
Feb 10, 2015, 2:33:40 PM2/10/15
to vim...@googlegroups.com
Believe it or not it was the omission of the word
IF from the list of reserved words. So I am
happier. But I wrote to Tim Pope asking if he can
fix the problem globally. And the problem with
tabs mentioned by Andrew Long annoys me also.
Thus far I don't have enough info to fix it for
myself. And again it needs to be fixed globally.

Stay tuned...

Andrew Long

unread,
Feb 10, 2015, 6:02:19 PM2/10/15
to vim...@googlegroups.com
On 10 Feb 2015, at 18:17, John Culleton wrote:
> On Tue, 10 Feb 2015 17:56:29 +0000
> Andrew Long <andre...@mac.com> wrote:
>
>> On 10 Feb 2015, at 15:57, John Culleton wrote:
>>> <snip/>
>>
>> I've had problems with COBOL.vim if smarttabs
>> are switched on, after starting a new line. The
>> problem is that the smart tabs don't count
>> properly towards working out the column
>> settings and so it highlights what *looks* like
>> it ought to be a valid line as invalid. I got
>> around this by switching off smart tabs in the
>> ftdetect.vim script
>>
> <snip/>
> Can't find ftdetect.vim script. Is there a better
> spelling of the name?

ftdetect is (can be) a subdirectory of vimfiles/.vim and (for me) holds language-specific vim scripts that identify the language type of a specific file. This allows you to declare variables and settings to control how editing a particular file type is edited.

I include the following lines in most of mys source-language edigting files:-


setlocal softtabstop=4
setlocal tabstop=4
setlocal expandtab
setlocal shiftwidth=4



You can set them in many difference plaes... in files in the ftplugin directory, somewhere in an 'after' file, in the filetype.vim script, etc.

Sorry if I wasn't too clear before. Yes, the cold is getting to me!

Andrew Long

unread,
Feb 10, 2015, 6:04:00 PM2/10/15
to vim...@googlegroups.com
On 10 Feb 2015, at 18:17, John Culleton wrote:
> On Tue, 10 Feb 2015 17:56:29 +0000
> Andrew Long <andre...@mac.com> wrote:
>
>> On 10 Feb 2015, at 15:57, John Culleton wrote:
>>> <snip/>
>>
>> I've had problems with COBOL.vim if smarttabs
>> are switched on, after starting a new line. The
>> problem is that the smart tabs don't count
>> properly towards working out the column
>> settings and so it highlights what *looks* like
>> it ought to be a valid line as invalid. I got
>> around this by switching off smart tabs in the
>> ftdetect.vim script
>>
> <snip/>
> Can't find ftdetect.vim script. Is there a better
> spelling of the name?

ftdetect is (can be) a subdirectory of vimfiles/.vim and (for me) holds language-specific vim scripts that identify the language type of a specific file. This allows you to declare variables and settings to control how editing a particular file type is edited.

I include the following lines in most of mys source-language edigting files:-


setlocal softtabstop=4
setlocal tabstop=4
setlocal expandtab
setlocal shiftwidth=4



You can set them in many difference plaes... in files in the ftplugin directory, somewhere in an 'after' file, in the filetype.vim script, etc.

Sorry if I wasn't too clear before. Yes, the cold is getting to me!

John Little

unread,
Feb 11, 2015, 9:12:02 PM2/11/15
to vim...@googlegroups.com
On Wednesday, February 11, 2015 at 8:33:40 AM UTC+13, wexfordpress wrote:
> Believe it or not it was the omission of the word
> IF from the list of reserved words.

From a distant memory, there is a reason for that. I'm sorry, your first post did not trigger the memory, but I've just diffed my cobol.vim from the standard one, and that unlocked things.

Your issue has been reported before:
https://groups.google.com/forum/?hl=en#!topic/vim_use/HGGIOkd_XcA

In hindsight, when that I posted to that thread I should have attempted to contact the syntax file's maintainer. (I suppose I assumed that he would have seen the thread.) I wasn't confident that my proposal was the best one, and I've never used vim with cobol, and only rarely ever saw legacy cobol let alone worked with it, though I did do lots of cobol-85 in free format.

My fix to the issue was to add cobolBadLine to the list of contained groups in the definition of cobolCondFlow:

syn region cobolCondFlow contains=ALLBUT,cobolLine,cobolBadLine start="\<\(IF\|INVALID\|END\|EOP\)\>" skip=/\('\|"\)[^"]\{-}\("\|'\|$\)/ end="\." keepend

I shall attempt to contact the maintainer. Again, sorry I didn't sort this out three years ago.

Regards, John Little

John Little

unread,
Feb 13, 2015, 6:34:31 PM2/13/15
to vim...@googlegroups.com
On Thursday, February 12, 2015 at 3:12:02 PM UTC+13, John Little wrote:
> On Wednesday, February 11, 2015 at 8:33:40 AM UTC+13, wexfordpress wrote:
> > Believe it or not it was the omission of the word
> > IF from the list of reserved words.
...
> My fix ...
> I shall attempt to contact the maintainer...

Tim Pope has responded saying my fix looks good, and will send a new version to Bram.

Regards, John Little

Martin Lindkvist

unread,
May 20, 2018, 3:19:28 AM5/20/18
to vim_use
Hello there...
Could you please pint me to the correct place to get this vim files ....
I have found them at various places but it would be nice to know that the one i use is the most resent and best working one


Best Regards
Martin Lindkvist

John Little

unread,
May 20, 2018, 6:08:11 AM5/20/18
to vim_use
On Sunday, May 20, 2018 at 7:19:28 PM UTC+12, Martin Lindkvist wrote:
> Could you please pint me to the correct place to get this vim files ....
> I have found them at various places but it would be nice to know that the one i use is the most resent and best working one

(A blast from the past... I haven't had the slightest thought about cobol for a long time.)
In your vim, look in

:edit $VIMRUNTIME/syntax/cobol.vim

The latest has:
" Last Change: 2015 Feb 13

To answer your question, vim is on github:

https://github.com/vim/vim/blob/master/runtime/syntax/cobol.vim

That says the file was changed on 1 September 2016; I suspect that was a vim facing change, rather than to do with cobol.

However, taking files individually may not be a good idea; if you can cope with an 80 MiB download following the instructions at https://www.vim.org/git.php could be better.

Regards, John Little

Reply all
Reply to author
Forward
0 new messages