Skip to content
This repository has been archived by the owner on Dec 25, 2017. It is now read-only.

Porting to vim #12

Closed
Jwong684 opened this issue Oct 22, 2017 · 5 comments
Closed

Porting to vim #12

Jwong684 opened this issue Oct 22, 2017 · 5 comments
Assignees
Labels

Comments

@Jwong684
Copy link
Collaborator

Jwong684 commented Oct 22, 2017

This is a useful tutorial to get into vim syntax:
http://vim.wikia.com/wiki/Creating_your_own_syntax_files

Enable syntax in ~/.vimrc:

syntax enable

There is essentially a vim folder in your home directory:
Make these subdirectories:

  • ~/.vim/syntax
  • ~/.vim/ftdetect
    The files in these subdirectories must match. (i.e. fasta.vim in each of those folders for *.fasta)
    in ftdetect/fasta.vim: (detects file formats)
au BufRead,BufNewFile *.fasta set filetype=fasta
au BufRead,BufNewFile *.fa set filetype=fasta

In syntax/fasta.vim: (specifications)

if exists("syntax_on")
        syntax reset
endif

syntax match comment ">.*$"
syntax match ntA "A"
syntax match ntG "G"
syntax match ntC "C"
syntax match ntT "T"

hi def link comment Identifier
highlight ntA ctermfg=Black ctermbg=Green guibg=#272822
highlight ntG ctermfg=Black ctermbg=Yellow guibg=#FF8C00
highlight ntC ctermfg=Black ctermbg=Blue guibg=#2A0AFD
highlight ntT ctermfg=Black ctermbg=Red guibg=#FD0A0A

Something kept breaking when I followed the online tutorial so I broke it down to this skeleton for now. More to come.

@fransilvion
Copy link
Collaborator

Hey, Jasper, I am back in the action! What type of file formats have you already done for vim? Is it only fasta? I will focus on pdb, vcf and bed (or you've done this one already?) files for now. If you need any help, just ask

@Jwong684
Copy link
Collaborator Author

Hey German,

I have also just started looking at this haha. I will do bed, since it seems relatively straightforward.

If you have any code pertaining to some useful regexp in vim, please share it on here. I think it would be more helpful to see your logic rather than rely on some variable forums on vim regexp.

Thank you!

Jasper

@ababaian ababaian added the port label Nov 17, 2017
@ababaian
Copy link
Owner

ababaian commented Nov 21, 2017

vim-faidx
@Jwong684 Vim Robust Column Selection is now solved: there might be another way to do using nextgroup= but we can worry about that if need be, this is good for now.

Faidx Column Selection Syntax

@ababaian
Copy link
Owner

ababaian commented Nov 21, 2017

@Jwong684
Copy link
Collaborator Author

Jwong684 commented Nov 21, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants