Adding a line to vimrc

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

 



I'm packaging Google's protocol buffers library and noticed that they
included a proto.vim to enable vim syntax highlighting, so I'm adding a
protocol-buffer-vim subpackage.

But, to do this I need to:
  1. Drop proto.vim into /usr/share/vim/vim71/syntax/
  2. Add 'autocmd BufRead,BufNewFile *.proto setfiletype proto/' to
/etc/vimrc

The first is easy enough. The second isn't too bad if I put this into
%post vim:
%{__cp} /etc/vimrc /etc/vimrc.rpmsave
sed 's/if has("autocmd")/if has("autocmd")\n  autocmd BufRead,BufNewFile
*.proto setfiletype proto/' /etc/vimrc.rpmsave > /etc/vimrc

and this into %postun vim:
%{__cp} /etc/vimrc /etc/vimrc.rpmsave
sed -e 's/autocmd BufRead,BufNewFile \*.proto setfiletype proto//'
/etc/vimrc.rpmsave > /etc/vim

I couldn't find anything on how I should go about modifying vimrc other
than this approach. Can anyone suggest a better approach?

-- 
fedora-devel-list mailing list
fedora-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-devel-list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux