Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for clustal #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions ftdetect/bio-vim.vim
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
augroup filetypedetect
au BufNewFile,BufRead *.fasta setf fasta
au BufNewFile,BufRead *.faa setf fasta_aa
au BufNewFile,BufRead *.{ffn,fna} setf fasta_nt
au BufNewFile,BufRead *.gff setf gff
au BufNewFile,BufRead *.{gbk,genbank} setf genbank
au BufRead,BufNewFile *.{nex,nexus,nxs,nx} setf nexus
au BufNewFile,BufRead *.{fasta,fas,fsa,fa} setf fasta
au BufNewFile,BufRead *.faa setf fasta_aa
au BufNewFile,BufRead *.{ffn,fna,fnt} setf fasta_nt
au BufNewFile,BufRead *.gff setf gff
au BufNewFile,BufRead *.{gb,gp,gbk,genbank} setf genbank
au BufRead,BufNewFile *.{nex,nexus,nxs,nx} setf nexus
au BufRead,BufNewFile *.aln setf clustal
augroup END
33 changes: 33 additions & 0 deletions syntax/clustal.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
" Vim syntax file
" Language: Clustal alignment
" Maintainer: Qinhu Wang <[email protected]>
" Last Change: Feb 2, 2015

" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif

" Clustal body
syn match seq_id "^\S\+\s\+"
syn match group1 "[GPST]"
syn match group2 "[HKR]"
syn match group3 "[FWY]"
syn match group4 "[ILMV]"
syn match gap "-"

" Clustal header
syn region clustalHeader start=/^CLUSTAL/ end=/\n$/ oneline

highlight clustalHeader ctermfg=blue guifg=blue
highlight seq_id ctermfg=magenta guifg=magenta
highlight group1 ctermfg=yellow guifg=yellow
highlight group2 ctermfg=red guifg=red
highlight group3 ctermfg=blue guifg=blue
highlight group4 ctermfg=green guifg=green
highlight gap ctermfg=grey guifg=grey

let b:current_syntax = "clustal"