Skip to content

Instantly share code, notes, and snippets.

@elvinio
Last active August 29, 2015 14:23
Show Gist options
  • Save elvinio/0c2b4c57a888d15196ef to your computer and use it in GitHub Desktop.
Save elvinio/0c2b4c57a888d15196ef to your computer and use it in GitHub Desktop.
" Fix syntax file
" Language: FIX
" Author: elvin.chua
" Created on: 16 June 2015
"
if exists("b:current_syntax")
finish
endif
let b:current_syntax = "fix"
syn match orderId "\v11\=\d+"
syn match orderId "\v41\=\d+"
syn match orderDetails "\v\|48\=\d+"
syn match orderDetails "\v44\=\d+.\d*"
syn match orderSide "\v54\=1"
syn match orderSide "\v54\=2"
syn match orderQty "\v32\=\d+"
syn match orderQty "\v38\=\d+"
syn match orderQty "\v14\=\d+"
syn match orderQty "\v151\=\d+"
syn match orderStatus "\v39\=\d+"
syn match orderStatus "\v150\=\d+"
syn match orderFill "\v150\=F"
syn match orderFill "\v39\=[1|2]"
syn match def "\v1180\=\d+"
syn match def "\v55\="
syn match def "\v1151\=\d+"
syn match def "\v1300\=\d+"
syn match def "\v264\=\d+"
highlight link orderDetails Identifier
highlight link orderId Underlined
highlight link orderStatus Type
highlight link def Type
highlight link orderQty Comment
highlight link orderSide Statement
highlight link orderFill Constant
@elvinio
Copy link
Author

elvinio commented Jun 16, 2015

Create syntax file

vi ~/.vim/syntax/fix.vim

Create file type detection

vi ~/.vim/ftdetect/fix.vim
au BufRead,BufNewFile *.fix set filetype=fix

Create alias

fl(){
cat $1 | tr '\1' '|' > /tmp/ttt.fix; vim -u /usr/share/vim/vim74/macros/less.vim /tmp/ttt.fix
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment