FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora Development

 
 
LinkBack Thread Tools
 
Old 08-13-2008, 08:48 PM
 
Default Adding a line to vimrc

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")
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@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-list
 
Old 08-13-2008, 08:57 PM
Till Maas
 
Default Adding a line to vimrc

On Wed August 13 2008, rvinyard@cs.nmsu.edu wrote:
> 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

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

You can drop a file with the line from step two in a file in this directory:
/usr/share/vim/vimfiles/ftdetect/

From vim-vimoutliner:
augroup filetypedetect
au! BufRead,BufNewFile *.otl setfiletype vo_base
au! BufRead,BufNewFile *.oln setfiletype xoutliner
augroup END

Regards,
Till
--
fedora-devel-list mailing list
fedora-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-list
 
Old 08-13-2008, 09:09 PM
 
Default Adding a line to vimrc

Perfect. Thanks.

> On Wed August 13 2008, rvinyard@cs.nmsu.edu wrote:
>> 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
>
>> I couldn't find anything on how I should go about modifying vimrc other
>> than this approach. Can anyone suggest a better approach?
>
> You can drop a file with the line from step two in a file in this
> directory:
> /usr/share/vim/vimfiles/ftdetect/
>
> From vim-vimoutliner:
> augroup filetypedetect
> au! BufRead,BufNewFile *.otl setfiletype vo_base
> au! BufRead,BufNewFile *.oln setfiletype xoutliner
> augroup END
>
> Regards,
> Till
> --
> fedora-devel-list mailing list
> fedora-devel-list@redhat.com
> https://www.redhat.com/mailman/listinfo/fedora-devel-list

--
fedora-devel-list mailing list
fedora-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-list
 
Old 08-13-2008, 09:11 PM
 
Default Adding a line to vimrc

Thanks for the pointer to vim-vimoutliner since I found a better place for
the syntax file than /usr/share/vim/vim71

> On Wed August 13 2008, rvinyard@cs.nmsu.edu wrote:
>> 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
>
>> I couldn't find anything on how I should go about modifying vimrc other
>> than this approach. Can anyone suggest a better approach?
>
> You can drop a file with the line from step two in a file in this
> directory:
> /usr/share/vim/vimfiles/ftdetect/
>
> From vim-vimoutliner:
> augroup filetypedetect
> au! BufRead,BufNewFile *.otl setfiletype vo_base
> au! BufRead,BufNewFile *.oln setfiletype xoutliner
> augroup END
>
> Regards,
> Till
> --
> fedora-devel-list mailing list
> fedora-devel-list@redhat.com
> https://www.redhat.com/mailman/listinfo/fedora-devel-list

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

Thread Tools




All times are GMT. The time now is 09:11 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org