Bug 1724126

Summary: Vim shows some template for .spec file even if I don't want to work with RPM, seems like a confusing default?
Product: [Fedora] Fedora Reporter: ell1e <el>
Component: vimAssignee: Karsten Hopp <karsten>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 29CC: gchamoul, karsten, praiskup, zdohnal
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: vim-8.1.1713-3.fc31 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-07-19 08:08:17 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description ell1e 2019-06-26 10:03:24 UTC
Description of problem:
Vim shows pre-filled file contents opening a new .spec file that seem to be related to packaging. I assume this is meant to make life easier for fedora packagers, but there are other pieces of software using .spec as a file ending like https://github.com/kivy/buildozer and it is a bit jarring that a new file opens up with some surprise, possibly quite unrelated/unfitting contents as DEFAULT behavior.

So I think this is very useful to have, I just don't think it should be the default as it appears to be right now unless it is somehow toggled on. Because it doesn't tell me how to toggle it off either, so essentially vim is kind of broken for me now for editing that sort of file. (I used nano as a workaround.)

Version-Release number of selected component (if applicable):
VIM - Vi IMproved 8.1 (2018 May 18, compiled Jun 17 2019 09:09:11)


How reproducible:
100%

Steps to Reproduce:
1. $ vim test.spec

Actual results:
A quite lengthy block of contents that means nothing to somebody not packaging an RPM thing (is this even what it is?) opens up even though this is a new file, and I never told vim I want to even work with RPMs (which I don't)

Expected results:
empty file

Additional info:

Comment 1 Zdenek Dohnal 2019-07-18 11:48:17 UTC
Hi Jonas,

thank you for reporting the issue! It is actually done by line in /etc/vimrc:

  autocmd BufNewFile *.spec 0r /usr/share/vim/vimfiles/template.spec

I'm not sure how many people find it useful, so let's ask on devel-list https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/PUPN2P5MJI2C4VMFFCRISDRLXCDM37RI/ .

If there is going to be majority opposition, I'll let the defaults as they are. You can always comment out that line in /etc/vimrc.

Comment 2 Zdenek Dohnal 2019-07-19 08:08:17 UTC
Seems nobody opposed turning it off, so I pushed the changes. They will come into Fedora 29/30 with update after current pending 8.1.1713 update. But be aware the change will not be applied automatically because /etc/vimrc is config file which is not replaced automatically. You need to look into /etc and rename new vimrc, which will be put there by dnf and have a suffix (IIRC .rpmnew or something), to be simple 'vimrc'.
I'll close it as RAWHIDE, because the fix is already in rawhide now, and it does not seem as critical issue which needs to be backported right now.

Comment 3 Pavel Raiskup 2020-10-06 08:37:21 UTC
> Seems nobody opposed turning it off

I'm was/am against, just to politely admit that publicly.  IMO the wast
majority of people _on Fedora_ expect that *.spec file is actually the
RPM spec file.