Charles,

thank you for your quick answer!
I tested your files but I wasn't able to figure out how to make them work, even 
following 
your advices.

I'm using Vim 7.0.305 on a Debian system, and I tried all the options I was 
aware of:
- copying all $HOME/.vim(/syntax) directories (that weren't there before I 
created them)
- copying all to the system-wide /usr/share/vim/vim70(/syntax) location

Surprisingly (at least for me), sourcing manually the file

  :source $HOME/.vim/syntax/pdb.vim

doesn't give any error.

Any clue?
Thanks again,

Stefano



Charles Campbell wrote:
> Stefano Forli wrote:
>> Dear list,
>>
>> as far as I can tell from my searches in the tips and the mailing list 
>> archives, no one 
>> already asked about this issue.
>>
>> I would be interested in creating a syntax scheme for the Proten Data Bank 
>> files format 
>> for atomic coordinates of proteins.
>>
>> In particular, it would be very useful to have different colors for columns 
>> (even 
>> alternate ones), since the format is sensitive to the position.
>>
>>
>> 1234567890123456789012345678901234567890123456789012345678901234567890123456789
>> |         |  |   |     |          |       |       |      |     |        |
>> ATOM   1428  N   ASP   207     -26.467 -19.015 -22.737  0.00  0.00    -0.337 
>> N
>> ATOM   1429  CA  ASP   207     -25.440 -18.835 -23.814  0.00  0.00     0.170 
>> C
>> ATOM   1430  C   ASP   207     -26.043 -19.413 -25.145  0.00  0.00     0.251 
>> C
>> ATOM   1431  O   ASP   207     -26.005 -18.729 -26.180  0.00  0.00    -0.271 
>> OA
>> ATOM   1432  CB  ASP   207     -24.127 -19.567 -23.531  0.00  0.00     0.129 
>> C
>>
>> The keywords should be pretty few.
>> The |usr_44.txt| help file states that "parts can be specific keywords or 
>> text matching a 
>> pattern". I found no mention to positional keys to be used, so I wonder if 
>> there is any 
>> way for doing that.
>>   
> Hello!
> 
> I've attached a syntax highlighting file; put it in   
> $HOME/.vim/syntax.  I've also attached a filetype.vim file;
> put it in $HOME/.vim  (or merge it with whatever's there).
> 
> I went by the bar placements rather than the apparent columnar data; its 
> easy enough to adjust.
> 
> Regards,
> Chip Campbell
> 
> 
> > 
> 
> 
> ------------------------------------------------------------------------
> 
> " filetype.vim:
> " Author: Charles E. Campbell, Jr.
> " Date:   Mar 18, 2009
> 
> if exists("did_load_myfiletypes")
>  finish
> endif
> let did_load_myfiletypes= 1
> 
> augroup filetypedetect
>  au BufNewFile,BufReadPost *.pdb              setf pdb
> augroup END
> 
> 
> ------------------------------------------------------------------------
> 
> " pdb.vim
> "   Author: Charles E. Campbell, Jr.
> "   Date:   Mar 18, 2009
> "   Version: 1a       NOT RELEASED
> " ---------------------------------------------------------------------
> "  Initialization {{{1
> " Remove any old syntax stuff hanging around
> syntax clear
> 
> " ---------------------------------------------------------------------
> "  Syntax {{{1
> syn match pdbCol1     /^.*\%11v/                                      
> nextgroup=pdbCol2 
> syn match pdbCol2     /\%11v.*\%14v/  contained       nextgroup=pdbCol3 
> syn match pdbCol3     /\%14v.*\%18v/  contained       nextgroup=pdbCol4 
> syn match pdbCol4     /\%18v.*\%24v/  contained       nextgroup=pdbCol5 
> syn match pdbCol5     /\%24v.*\%35v/  contained       nextgroup=pdbCol6 
> syn match pdbCol6     /\%35v.*\%43v/  contained       nextgroup=pdbCol7 
> syn match pdbCol7     /\%43v.*\%51v/  contained       nextgroup=pdbCol8 
> syn match pdbCol8     /\%51v.*\%58v/  contained       nextgroup=pdbCol9 
> syn match pdbCol9     /\%58v.*\%64v/  contained       nextgroup=pdbCol10
> syn match pdbCol10    /\%64v.*\%73v/  contained       nextgroup=pdbCol11
> syn match pdbCol11    /\%73v.*$/              contained
> 
> " ---------------------------------------------------------------------
> "  Highlighting {{{1
> if !exists("b:did_pdb_syntax_inits")
>   let b:did_pdb_syntax_inits = 1
> 
>   hi def link pdbCol1         Red
>   hi def link pdbCol2         Yellow
>   hi def link pdbCol3         Green
>   hi def link pdbCol4         Magenta
>   hi def link pdbCol5         Cyan
>   hi def link pdbCol6         White
>   hi def link pdbCol7         Red
>   hi def link pdbCol8         Yellow
>   hi def link pdbCol9         Green
>   hi def link pdbCol10        Magenta
>   hi def link pdbCol11        Cyan
>   endif
> " ---------------------------------------------------------------------
> " vim: ts=4 fdm=marker


-- 
  Stefano Forli, PhD

  Research Associate
  Olson Molecular Graphics Laboratory
  Dept. Molecular Biology,  MB-5
  The Scripps Research Institute
  10550  North Torrey Pines Road
  La Jolla,  CA 92037-1000,  USA.

     tel: (858) 784-2055
     fax: (858) 784-2860
     email: [email protected]

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to