[vim/vim] Vim cannot write *.vba files (#2694)

35 views
Skip to first unread message

Bastien Orivel

unread,
Mar 6, 2018, 9:55:39 AM3/6/18
to vim/vim, Subscribed

Vim says: E382: Cannot write, 'buftype' option is set when you try to write a .vba file.

Steps to reproduce:

  • vim toto.vba
  • :wq

The problems seems to be coming from this line: https://github.com/vim/vim/blob/946acdac5b4e334f816e78f7876bde9d97b3d96a/runtime/plugin/vimballPlugin.vim#L31 as commenting it out "fixes" the bug.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub

Christian Brabandt

unread,
Mar 6, 2018, 10:03:59 AM3/6/18
to vim/vim, Subscribed

Oh, I am surprised this has been finally noted. .vba files where initially used as vimball files to distribute vim plugins and it has been later switched to .vmb format.
cc @cecamp
perhaps its time to drop support for the old .vba vimball format and only use .vmb, since vba could be legitimite files after all.

To workaround it, if you need to write a legimitate .vba file, simply set the buftype option to empty: :set bt=

Niklas Saari

unread,
Sep 24, 2020, 6:36:29 AM9/24/20
to vim/vim, Subscribed

This issue seems to still happen. I was wondering, why I could not save files in .vba type.


You are receiving this because you are subscribed to this thread.

Reply to this email directly, view it on GitHub, or unsubscribe.

Christian Brabandt

unread,
Sep 24, 2020, 6:45:32 AM9/24/20
to vim/vim, Subscribed

if you do not intend to use vimballs, you can also disable it by setting

 let g:loaded_vimballPlugin=1

in your .vimrc. Then it shouldn't happen.


You are receiving this because you are subscribed to this thread.

Reply to this email directly, view it on GitHub, or unsubscribe.

Niklas Saari

unread,
Sep 24, 2020, 7:10:50 AM9/24/20
to vim/vim, Subscribed

if you do not intend to use vimballs, you can also disable it by setting

 let g:loaded_vimballPlugin=1

in your .vimrc. Then it shouldn't happen.

Seems to solve issue in my case. Thank you.


You are receiving this because you are subscribed to this thread.

Reply to this email directly, view it on GitHub, or unsubscribe.

Brandon Wallace

unread,
Mar 16, 2023, 9:00:29 AM3/16/23
to vim/vim, Subscribed

came here because I just encountered this. Luckily for me it was a one-time need and only cost me some minutes of googling to figure out how to workaround it 🙄 .


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/2694/1471911025@github.com>

dkearns

unread,
Aug 19, 2023, 1:27:22 PM8/19/23
to vim/vim, Subscribed

I was just updating the Visual Basic file type detection and was going to add support for *.vba files.

Unfortunately, there's some Vimball functionality triggered with BufEnter autocommands which I don't think can reasonably be disabled as it stands.

It seems to me that the easiest solution might be to make a dedicated filetype for Vimballs. Then the autocommands can use FileType instead.


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/2694/1685057559@github.com>

Christian Brabandt

unread,
Aug 19, 2023, 4:12:04 PM8/19/23
to vim/vim, Subscribed

Yes, probably should get vimball as an own filetype. And possibly also get rid of .vba as extension for vimball. It's been long gone and nowadays vimballs use the .vmb extension anyhow.


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/2694/1685099058@github.com>

Gary Johnson

unread,
Aug 23, 2023, 12:04:01 PM8/23/23
to reply+ACY5DGCDSA2HRVRFTZ...@reply.github.com, vim...@googlegroups.com
On 2023-08-19, Christian Brabandt wrote:
> Yes, probably should get vimball as an own filetype. And possibly also get rid
> of .vba as extension for vimball. It's been long gone and nowadays vimballs use
> the .vmb extension anyhow.

All of the vimballs I have from Chip Campbell use the .vba
extension.

The first line of a .vba file could be inspected to determine
whether it was a vimball.

Regards,
Gary

vim-dev ML

unread,
Aug 23, 2023, 12:04:22 PM8/23/23
to vim/vim, vim-dev ML, Your activity


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/2694/1690231336@github.com>

Christian Brabandt

unread,
Aug 23, 2023, 12:19:45 PM8/23/23
to vim...@googlegroups.com, reply+ACY5DGCDSA2HRVRFTZ...@reply.github.com

On Mi, 23 Aug 2023, Gary Johnson wrote:

> All of the vimballs I have from Chip Campbell use the .vba
> extension.
>
> The first line of a .vba file could be inspected to determine
> whether it was a vimball.

Oh, that is true. I just checked the website
http://www.drchip.org/astronaut/vim/index.html

I also checked the documentation for the vimball:

,----
| 33 : Apr 02, 2011 * Gave priority to *.vmb over *.vba
| * Changed silent! to sil! (shorter)
| * Safed |'swf'| setting (during vimball extraction,
| its now turned off)
`----

Oh well ...

Best,
Christian
--
I am the wandering glitch -- catch me if you can.

vim-dev ML

unread,
Aug 23, 2023, 12:20:05 PM8/23/23
to vim/vim, vim-dev ML, Your activity


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/2694/1690257412@github.com>

dkearns

unread,
Aug 26, 2023, 1:18:32 PM8/26/23
to vim/vim, vim-dev ML, Comment

On 2023-08-19, Christian Brabandt wrote: Yes, probably should get vimball as an own filetype. And possibly also get rid of .vba as extension for vimball. It's been long gone and nowadays vimballs use the .vmb extension anyhow.

All of the vimballs I have from Chip Campbell use the .vba extension. The first line of a .vba file could be inspected to determine whether it was a vimball.

Yes, that's what I've done for now, in the simplest way possible.

Creating a separate filetype has other advantages but, of course, only works when filetype support is enabled. I might still do that in a separate PR.

Thanks.


Reply to this email directly, view it on GitHub.
You are receiving this because you commented.Message ID: <vim/vim/issues/2694/1694414887@github.com>

Christian Brabandt

unread,
Aug 27, 2023, 12:47:31 PM8/27/23
to vim/vim, vim-dev ML, Comment

Closed #2694 as completed via f97f6bb.


Reply to this email directly, view it on GitHub.
You are receiving this because you commented.Message ID: <vim/vim/issue/2694/issue_event/10202140970@github.com>

Reply all
Reply to author
Forward
0 new messages