├── ftdetect └── bio-vim.vim ├── README.md └── syntax ├── genbank.vim ├── fasta.vim ├── fasta_aa.vim ├── fasta_nt.vim ├── gff.vim └── nexus.vim /ftdetect/bio-vim.vim: -------------------------------------------------------------------------------- 1 | augroup filetypedetect 2 | au BufNewFile,BufRead *.fasta setf fasta 3 | au BufNewFile,BufRead *.faa setf fasta_aa 4 | au BufNewFile,BufRead *.{ffn,fna} setf fasta_nt 5 | au BufNewFile,BufRead *.gff setf gff 6 | au BufNewFile,BufRead *.{gbk,genbank} setf genbank 7 | au BufRead,BufNewFile *.{nex,nexus,nxs,nx} setf nexus 8 | augroup END 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Introdoction 2 | 3 | Bioinformatics support for vim. 4 | 5 | # Install 6 | 7 | The recommended way is to use [pathogen][], [vundle][] or perhaps even [unbundle][]. 8 | 9 | Otherwise you can just copy the files to their respective subdirectory into your .vim directory. 10 | 11 | [pathogen]: https://github.com/tpope/vim-pathogen 12 | [vundle]: https://github.com/gmarik/vundle 13 | [unbundle]: https://github.com/sunaku/vim-unbundle 14 | -------------------------------------------------------------------------------- /syntax/genbank.vim: -------------------------------------------------------------------------------- 1 | " Vim syntax file 2 | " Language: Genbank 3 | " Maintainer: Johan Viklund 4 | " Last Change: 2012 Nov 06 5 | 6 | if version < 600 7 | syntax clear 8 | elseif exists("b:current_syntax") 9 | finish 10 | endif 11 | 12 | syntax match gbkDefinition /^[A-Z]*/ 13 | syntax match gbkDefinition /^ \?[A-Z]*/ 14 | 15 | "syntax region gbkFeatureLine start=/^ [a-zA-Z]\+/ end=/$/ 16 | "syntax region gbkFeature start=/^ [a-zA-Z]\+/ end=/^ [a-zA-Z]\+/re=e-9 contains=gbkFeatureAnnotation keepend 17 | 18 | "syntax region gbkFeatureAnnotation start=/^ \/[a-zA-Z_]*/ end=/^ \/[a-zA-Z_]*/ end=/^ [a-zA-Z]\+/ contained 19 | 20 | syntax match gbkFeatureType /^ [a-zA-Z][a-zA-Z]*/ containedin=gbkFeature 21 | syntax match gbkFeatureLocation /\(complement(\)\?<\?\d\+\.\.>\?\d\+)\?/ containedin=gbkFeatureLine 22 | 23 | syntax match gbkFeatureAnnotation /^ \+\/[a-zA-Z_]*/ 24 | 25 | syntax region gbkQuotedString start=/"/ end=/"/ 26 | 27 | "syntax region gbkFeatureType start=/[^ ]/ end=' ' 28 | "syntax match gbkFeatureLocation /[0-9]*/ containedin=gbkFeatureLine 29 | 30 | "syntax match gbkDefinition ^LOCUS 31 | 32 | 33 | highlight link gbkDefinition Keyword 34 | highlight link gbkFeatureType Constant 35 | highlight link gbkFeatureLocation Number 36 | highlight link gbkFeatureAnnotation Identifier 37 | 38 | highlight link gbkFeature Comment 39 | highlight link gbkQuotedString Comment 40 | 41 | 42 | let b:current_syntax = "genbank" 43 | -------------------------------------------------------------------------------- /syntax/fasta.vim: -------------------------------------------------------------------------------- 1 | " Vim syntax file 2 | " Based on syntax file from http://www.vim.org/scripts/script.php?script_id=2192 (Luis-Miguel Rodriguez ) 3 | " Language: Fasta (Pearson) 4 | " Maintainer: Johan Viklund 5 | " Last Change: 2012 Nov 06 6 | 7 | " For version 5.x: Clear all syntax items 8 | " For version 6.x: Quit when a syntax file was already loaded 9 | if version < 600 10 | syntax clear 11 | elseif exists("b:current_syntax") 12 | finish 13 | endif 14 | 15 | " defline 16 | syn region defline start=+^>+ end=+\n+ oneline contains=defline_desc,defline_sign,defline_kw 17 | syn match defline_sign "\(>\||\)" contained 18 | syn match defline_desc "[^|>]*$" contained 19 | syn keyword defline_kw gi dbj emb gb gp sp pir ref pdb lcl gnl 20 | 21 | " comment 22 | syn region comment_line start=+^;+ end=+\n+ oneline 23 | 24 | " sequence 25 | syn region seq_line start=+^[^>;]+ end=+\n+ contains=seq_error,seq_sp 26 | syn match seq_error +[JjOo]\|[^A-Za-z*-]+ contained 27 | syn match seq_sp +[* -]+ contained 28 | 29 | 30 | " Define the default highlighting. 31 | " For version 5.7 and earlier: only when not done already 32 | " For version 5.8 and later: only when an item doesn't have highlighting yet 33 | if version >= 508 || !exists("did_config_syntax_inits") 34 | if version < 508 35 | let did_config_syntax_inits = 1 36 | command -nargs=+ HiLink hi link 37 | else 38 | command -nargs=+ HiLink hi def link 39 | endif 40 | HiLink defline Special 41 | HiLink defline_sign Operator 42 | HiLink defline_desc Comment 43 | HiLink defline_kw Keyword 44 | HiLink comment_line Comment 45 | HiLink seq_line String 46 | HiLink seq_error Error 47 | HiLink seq_sp IncSearch 48 | delcommand HiLink 49 | endif 50 | 51 | let b:current_syntax = "fasta" 52 | 53 | " vim: ts=4 54 | -------------------------------------------------------------------------------- /syntax/fasta_aa.vim: -------------------------------------------------------------------------------- 1 | " Vim syntax file 2 | " Based on syntax file from http://www.vim.org/scripts/script.php?script_id=2192 (Luis-Miguel Rodriguez ) 3 | " Language: Fasta (Pearson) (aminoacids) 4 | " Maintainer: Johan Viklund 5 | " Last Change: 2012 Nov 06 6 | 7 | " For version 5.x: Clear all syntax items 8 | " For version 6.x: Quit when a syntax file was already loaded 9 | if version < 600 10 | syntax clear 11 | elseif exists("b:current_syntax") 12 | finish 13 | endif 14 | 15 | " defline 16 | syn region defline start=+^>+ end=+\n+ oneline contains=defline_desc,defline_sign,defline_kw 17 | syn match defline_sign "\(>\||\)" contained 18 | syn match defline_desc "[^|>]*$" contained 19 | syn keyword defline_kw gi dbj emb gb gp sp pir ref pdb lcl gnl 20 | 21 | " comment 22 | syn region comment_line start=+^;+ end=+\n+ oneline 23 | 24 | " sequence 25 | syn region seq_line start=+^[^>;]+ end=+\n+ contains=seq_error,seq_sp 26 | syn match seq_error +[JjOo]\|[^A-Za-z*-]+ contained 27 | syn match seq_sp +[* -]+ contained 28 | syn match seqAmbig +[BZXbzx]+ 29 | 30 | " [^ARNDCEQGHILKMFPSTWYVarndceqghilkmfpstwyv-] 31 | 32 | 33 | " Define the default highlighting. 34 | " For version 5.7 and earlier: only when not done already 35 | " For version 5.8 and later: only when an item doesn't have highlighting yet 36 | if version >= 508 || !exists("did_config_syntax_inits") 37 | if version < 508 38 | let did_config_syntax_inits = 1 39 | command -nargs=+ HiLink hi link 40 | else 41 | command -nargs=+ HiLink hi def link 42 | endif 43 | HiLink defline Special 44 | HiLink defline_sign Operator 45 | HiLink defline_desc Comment 46 | HiLink defline_kw Keyword 47 | HiLink comment_line Comment 48 | HiLink seq_line String 49 | HiLink seq_error Error 50 | HiLink seq_sp IncSearch 51 | HiLink seqAmbig SpecialChar 52 | delcommand HiLink 53 | endif 54 | 55 | let b:current_syntax = "fasta_aa" 56 | 57 | " vim: ts=4 58 | -------------------------------------------------------------------------------- /syntax/fasta_nt.vim: -------------------------------------------------------------------------------- 1 | " Vim syntax file 2 | " Based on syntax file from http://www.vim.org/scripts/script.php?script_id=2192 (Luis-Miguel Rodriguez ) 3 | " Language: Fasta (Pearson) (nucleotides) 4 | " Maintainer: Johan Viklund 5 | " Last Change: 2012 Nov 06 6 | 7 | " For version 5.x: Clear all syntax items 8 | " For version 6.x: Quit when a syntax file was already loaded 9 | if version < 600 10 | syntax clear 11 | elseif exists("b:current_syntax") 12 | finish 13 | endif 14 | 15 | " defline 16 | syn region defline start=+^>+ end=+\n+ oneline contains=defline_desc,defline_sign,defline_kw 17 | syn match defline_sign "\(>\||\)" contained 18 | syn match defline_desc "[^|>]*$" contained 19 | syn keyword defline_kw gi dbj emb gb gp sp pir ref pdb lcl gnl 20 | 21 | " comment 22 | syn region comment_line start=+^;+ end=+\n+ oneline 23 | 24 | " sequence 25 | syn region seq_line start=+^[^>;]+ end=+\n+ contains=seq_error,seq_sp,seqAmbig 26 | syn match seq_error +[EFJLOPQZefjlopqz]\|[^A-Za-z*-]+ contained 27 | syn match seq_sp +[* -]+ contained 28 | syn match seqAmbig +[RYKMSWBDHVNrykmswbdhvn]+ 29 | 30 | " [^ARNDCEQGHILKMFPSTWYVarndceqghilkmfpstwyv-] 31 | 32 | 33 | " Define the default highlighting. 34 | " For version 5.7 and earlier: only when not done already 35 | " For version 5.8 and later: only when an item doesn't have highlighting yet 36 | if version >= 508 || !exists("did_config_syntax_inits") 37 | if version < 508 38 | let did_config_syntax_inits = 1 39 | command -nargs=+ HiLink hi link 40 | else 41 | command -nargs=+ HiLink hi def link 42 | endif 43 | HiLink defline Special 44 | HiLink defline_sign Operator 45 | HiLink defline_desc Comment 46 | HiLink defline_kw Keyword 47 | HiLink comment_line Comment 48 | HiLink seq_line String 49 | HiLink seq_error Error 50 | HiLink seq_sp IncSearch 51 | HiLink seqAmbig SpecialChar 52 | delcommand HiLink 53 | endif 54 | 55 | let b:current_syntax = "fasta_nt" 56 | 57 | " vim: ts=4 58 | -------------------------------------------------------------------------------- /syntax/gff.vim: -------------------------------------------------------------------------------- 1 | " Vim syntax file 2 | " Most of it copied from an unknown source, please let me know if you can find 3 | " it, so credit can be given. 4 | " Language: General Feature Format 5 | " Maintainer: Johan Viklund 6 | " Last Change: 2012 Nov 06 7 | 8 | if version < 600 9 | syntax clear 10 | elseif exists("b:current_syntax") 11 | finish 12 | endif 13 | 14 | syntax match gffDirective /^##.*$/ contains=gffSeq 15 | syntax include @FASTA :p:h/fasta.vim 16 | syntax region gffSeq start=/^##FASTA$/rs=e+1 end=+\%$+ contains=@FASTA contained 17 | 18 | 19 | " These are the different columns in a gff file 20 | " 1 seqid 21 | " 2 source Program that found the feature 22 | " 3 type SOFA term (CDS or SO:\d+) 23 | " 4 start positive int 24 | " 5 end positive int >= start 25 | " 6 score float or . 26 | " 7 strand + - 27 | " 8 phase . 0 1 2 28 | " 9 attributes 29 | 30 | syntax region gffSeqID matchgroup=gffSeqID start=+^[^#]+ end=+$+ contains=gffSource keepend oneline 31 | syntax region gffSource matchgroup=gffSource start=+\t+ end=+$+ contained contains=gffType keepend oneline 32 | syntax region gffType matchgroup=gffType start=+\t+ end=+$+ contained contains=gffStart keepend oneline 33 | syntax region gffStart matchgroup=gffStart start=+\t+ end=+$+ contained contains=gffEnd keepend oneline 34 | syntax region gffEnd matchgroup=gffEnd start=+\t+ end=+$+ contained contains=gffScore keepend oneline 35 | syntax region gffScore matchgroup=gffScore start=+\t+ end=+$+ contained contains=gffStrand keepend oneline 36 | syntax region gffStrand matchgroup=gffStrand start=+\t+ end=+$+ contained contains=gffPhase keepend oneline 37 | syntax region gffPhase matchgroup=gffPhase start=+\t+ end=+$+ contained contains=gffAttributes keepend oneline 38 | syntax region gffAttributes matchgroup=gffAttributes start=+\t+ end=+$+ contained keepend oneline 39 | 40 | 41 | syntax match gffStrandErr +[^+-]+ containedin=gffStrand contained contains=gffPhase 42 | syntax match gffPhaseErr +[^\.012]+ containedin=gffPhase contained contains=gffAttributes 43 | syntax match gffStartErr +[^0-9]+ containedin=gffStart contained contains=gffEnd 44 | syntax match gffEndErr +[^0-9]+ containedin=gffEnd contained contains=gffScore 45 | syntax match gffAttrID +[A-Z]\S=\++ containedin=gffAttributes contained 46 | 47 | 48 | highlight link gffDirective Comment 49 | highlight link gffFasta Comment 50 | 51 | highlight link gffSeqID Identifier 52 | highlight link gffSource Constant 53 | highlight link gffType Keyword 54 | highlight link gffStart Number 55 | highlight link gffEnd Number 56 | highlight link gffScore Float 57 | highlight link gffStrand Operator 58 | 59 | highlight link gffPhase Operator 60 | highlight link gffAttributes Identifier 61 | 62 | highlight link gffAttrID Keyword 63 | 64 | highlight link gffStrandErr Error 65 | highlight link gffPhaseErr Error 66 | highlight link gffStartErr Error 67 | highlight link gffEndErr Error 68 | 69 | let b:current_syntax = "gff" 70 | -------------------------------------------------------------------------------- /syntax/nexus.vim: -------------------------------------------------------------------------------- 1 | " Vim syntax file 2 | " Based on syntax file from Johan Nylander 3 | " Language: Nexus data format, PAUP and MrBayes commands. 4 | " Maintainer: Johan Viklund 5 | " Last Change: 2012 Nov 06 6 | 7 | " For version 5.x: Clear all syntax items 8 | " For version 6.x: Quit when a syntax file was already loaded 9 | if version < 600 10 | syntax clear 11 | elseif exists("b:current_syntax") 12 | finish 13 | endif 14 | 15 | syn case ignore 16 | 17 | " Nexus TODO 18 | syn keyword nexusTodo contained TODO 19 | 20 | " #NEXUS title 21 | syn keyword nexusTitle NEXUS 22 | 23 | " Nexus Blocks 24 | syn keyword nexusBlockCommands assumptions begin characters codons data distances end paup sets taxa trees mrbayes 25 | 26 | " Nexus Data commands 27 | syn keyword nexusDataCommands dimensions format matrix translate tree options 28 | 29 | " Nexus Data parameter 30 | syn keyword nexusDataParameters datatype equate gap interleave matchchar missing ntax nchar 31 | 32 | " Nexus Data options 33 | syn keyword nexusDataOptions continuous dna morphology rna protein restriction mixed standard 34 | 35 | " PAUP Commands 36 | syn keyword nexusPaupCommands agree alltrees assume bandb base basefreqs boot bootstrap cd charpartition charset cleartrees condense constraints contree cstatus ctype del delete deroottrees describetrees dos dscores defaults dset edit exclude exe execute export exset filter factory fstatus gammaplot generatetrees gettrees hompart hsearch help include ingroup jackknife lake loadconstr lscores leave log lset lscores matrixrep mprsets nj outgroup pairdiff permute pscores pset puzzle quit randtrees rateset reconstruct restore revfilter reweight roottrees saveassum savedist savetrees set showanc showconstr showdist showmatrix showcharparts showratesets showtaxparts showtrees showusertypes sorttrees stardecomp surfcheck taxpartition taxset time tonexus treedist treeinfo treewts tstatus typeset undelete upgma usertype weights wts wtset 37 | 38 | " Paup Parameters/Keyword 39 | syn keyword nexusPaupParameters adams addseq allsitesmean ancstates apolist append backbone base basefreq bseed breakties brlens charsperline chglist class cmlabels cmshoweq cmcolwid cmcstatus collapse conlevel constraints converse convexity crit criterion cutoffpct dcollapse deldupes diag displayout distance dstatus enforce estfreq excluded exset fd fdclasses fdfile fdonly fdtype file full fvalue grpfreq hennig homoplasy increase indices interleaved keep keepall labelnodes le50 linebreaks longfmt majrule maxtrees missdist monophyly mprsets mstaxa mulpars multrees ncat nchar negbrlen nowarn nreps nst objective ordphylip outroot patristic percent pinv pinvar plot power rates rclass removefreq replace reprate rmat rmatrix scorefile search semistrict shape showtree sitepartition sorttrees status strict subst swap tcompress treefile trees typeset unordphylip upbound usetreewts warnreset warntree warntsave wts wtset xout 40 | 41 | " Paup Options/Option type 42 | syn keyword nexusPaupOptions abs allow altnexus ambequal asis barchart bincode both constant current custom cladogram dist doswindows equal empirical est estimate f81 f84 faststep freqpars furthest gamma gtr hennig heuristic hide histogram hky85 ignore infer internal jc k2p k3p kmaxmini like likelihood logdet lsfit lundberg macintosh maxbrlens maxmini me mean median midpoint minbrlen ml monophyl native neili nexus nj nni no none off only p paraphyl parsimony phylip phylogram prev previous prohibit proportional polytomy purge repeatcnt setabsval sets setzero show simple sitespec spr tabtext tbr tajnei tamnei terminal text ti total tratio tv uncertain unmodified unix upgma upholt user yes 43 | 44 | 45 | " MrBayes Commands 46 | syn keyword nexusMbCommands about acknowledgments charset charstat citations comparetree constraint ctype databreaks delete deroot disclaimer exclude execute help include link log lset manual mcmc mcmcp outgroup pairs partition plot prset props quit report restore root set showmatrix showmodel showtree sump sumt taxastat taxset unlink usertree 47 | 48 | " MrBayes Parameters 49 | syn keyword nexusMbParameters aamodelpr allchains allcomps ancstates append applyto autoclose brlens brlenspr b burnin burninfrac calctreeprobs code coding codoncatfreqs contype correlation coswitchpr covarion diagnfreq displaygeq extincionrates extinctionpr filename filename1 filename2 growthrate growthpr irreversible m3omegapr marglike match mcmcdiagn minpartfreq nbetacat nchains ngammacat ngen nowarn nowarnings nperts nruns nst nswaps ntrees nucmodel ny98omega3pr ny98omega1pr omega omegapr omegavar ordered ordertaxa outputname parsmodel parameter partition pinvar pinvarpr ploidy possel print printall printfreq printmax print printtofile ratecorrpr ratemult rates ratepr replace relburnin reweight revmat revmatpr samplefreq sampleprob savebrlens seed shape shapepr showtreeprobs siterates speciationpr speciationrates start startingtree statefreq statefreqpr stop stopval stoprule swapfreq swapseed switchrates symmetricbetapr table temp theta thetapr tratio tratiopr topology topologypr unordered 50 | 51 | " MrBayes Options 52 | syn keyword nexusMbOptions 4by4 adgamma all allcompat beta ciliates clock codon consistentwith constraints default diploid dir dirichlet doublet equal exp exponential fixed gamma halfcompat haploid invgamma infinity m3 metmt mycoplasma no noabsencesites normal nopresencesites ny98 perfect propinv random ratio scaled unconstrained uni uniform universal user var variable vertmt yeast yes 53 | 54 | " Nexus Comments 55 | syn region nexusComments start=/\[/ end=/\]/ contains=nexusComments 56 | 57 | " Define the default highlighting. 58 | " For version 5.7 and earlier: only when not done already 59 | " For version 5.8 and later: only when an item doesn't have highlighting yet 60 | if version >= 508 || !exists("did_nexus_syntax_inits") 61 | if version < 508 62 | let did_nexus_syntax_inits = 1 63 | command -nargs=+ HiLink hi link 64 | else 65 | command -nargs=+ HiLink hi def link 66 | endif 67 | HiLink nexusTitle Title 68 | HiLink nexusBlockCommands Type 69 | HiLink nexusDataCommands Identifier 70 | HiLink nexusPaupCommands Identifier 71 | HiLink nexusMbCommands Identifier 72 | HiLink nexusDataParameters Constant 73 | HiLink nexusPaupParameters Constant 74 | HiLink nexusMbParameters Constant 75 | HiLink nexusDataOptions Statement 76 | HiLink nexusPaupOptions Statement 77 | HiLink nexusMbOptions Statement 78 | HiLink nexusComments Comment 79 | HiLink nexusTodo Todo 80 | delcommand HiLink 81 | endif 82 | 83 | let b:current_syntax = "nexus" 84 | --------------------------------------------------------------------------------