This is a really cool tip I stumbled onto while working with some of the packages on my team.  A couple months back I was editing a spec file and accidentally mistyped the name of the spec file.  Much to my surprise most of the file was completely missing.  After several :q! I finally realized that vi has a skeleton spec file that gets generated when edit a *.spec file that doesn’t exist yet.
So, for example if you typed:
vi mypackage.spec
you would get:
#
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# norootforbuild
Name: mypackage
Version:
Release:
Summary:
Group:
License:
Url:
PreReq:
Provides:
BuildRequires:
Source:
Patch:
BuildRoot: %{_tmppath}/%{name}-%{version}-build
AutoReqProv: on
%description
Authors:
--------
Name Surname
%prep
%setup
%build
%configure
make %{?jobs:-j%jobs}
%install
%makeinstall
%clean
rm -rf $RPM_BUILD_ROOT
%post
%postun
%files
%defattr(-,root,root)
%doc ChangeLog README COPYING
%changelog
* Wed Jan 13 2010 sshaw at stshaw.site
[...] 今天早上在 Decriptor’s Blog 看到的一個技巧分享,以往å†ç·¨è¼¯ RPM SPEC 檔案時始終å分é ç—›è£é¢çš„æ ¼å¼ï¼Œç¾åœ¨ç•¶ä½ å† SUSE Linuxä¸é€éŽ vi XXX.spec 時,便會自動æä¾›ä¸€å€‹å®Œæ•´çš„ SPEC æ ¼å¼è®“ä½ ä½¿ç”¨ï¼Œå分方便與實用的技巧 ^^ [...]
Wow, really works! Thx
Is this on 11.2? I do not see it in my nearly-default install box. Wondering what package it comes from…