Skip to content

Instantly share code, notes, and snippets.

@dpyro
Created August 29, 2012 05:26
Show Gist options
  • Save dpyro/3507094 to your computer and use it in GitHub Desktop.
Save dpyro/3507094 to your computer and use it in GitHub Desktop.
Vim syntax file for FASTA (fna)
" Vim syntax file
" Language: FASTA nucleotide sequences (fna)
" Maintainer: Sumant Manne <[email protected]>
" Latest Revision: 28 August 2012
" Based on Luis-Miguel Rodriguez <[email protected]>'s fasta.vim syntax
if exists("b:current_syntax")
finish
endif
" defline
syn region fnaHeader start=+^>+ end=+\n+ oneline contains=fnaHeaderSym,fnaHeaderId
syn match fnaHeaderId +.*$+ contained
syn match fnaHeaderSym +^>+ contained
" comment
syn region fnaComment start=+^;+ end=+\n+ oneline
" sequence
syn region fnaSequence start=+^[^>;]+ end=+\n+ contains=fnaSeqMasked,fnaSeqN
syn match fnaSeqMasked +[a-z]+ contained
syn match fnaSeqN +[Nn]+ contained
hi def link fnaHeaderSym Operator
hi def link fnaHeaderId Function
hi def link fnaComment Comment
hi def link fnaSequence String
hi def link fnaSeqMasked Special
hi def link fnaSeqN Ignore
let b:current_syntax="fna"
" vim: ts=4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment