[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: changelog format



On Mon, Apr 20, 2009 at 8:45 PM, Ville Skyttä <ville skytta iki fi> wrote:
> What rpmdevtools does for *Emacs users is that it makes opening a new
> $foo.spec automatically use the corresponding rpmdevtools spec template for
> $foo as emitted by rpmdev-newspec, and adjusts a few more or less cosmetic
> variables.  If there's a way to do something similar with vim (which currently
> appears to be using always the same template shipped in vim-common regardless
> of $foo) or other editors, patches are welcome in Bugzilla or
> fedorahosted.org/rpmdevtools

would probably want to be a patch against vim rather than rpmdevtools
since that's where the rest of the spec stuff is at the minute.
Something like this maybe?

Index: vimrc
===================================================================
RCS file: /cvs/pkgs/rpms/vim/devel/vimrc,v
retrieving revision 1.20
diff -u -r1.20 vimrc
--- vimrc	3 Jun 2008 14:34:32 -0000	1.20
+++ vimrc	21 Apr 2009 14:32:53 -0000
@@ -25,7 +25,11 @@
   " don't write swapfile on most commonly used directories for NFS
mounts or USB sticks
   autocmd BufNewFile,BufReadPre /media/*,/mnt/* set
directory=~/tmp,/var/tmp,/tmp
   " start with spec file template
-  autocmd BufNewFile *.spec 0r /usr/share/vim/vimfiles/template.spec
+  if executable("rpmdev-newspec")
+    autocmd BufNewFile *.spec exe "rpmdev-newspec -o - ".bufname("%")
+  else
+    autocmd BufNewFile *.spec 0r /usr/share/vim/vimfiles/template.spec
+  endif
   augroup END
 endif



-- 
Iain.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]