How to properly enable syntax highlighting for Mathematica in Vim? -


How to properly enable syntax highlighting for mathematics in VIM? I want it to automatically open M files with V files when opening.

You create a custom syntax file in two steps:

create ~ / .vim / syntax / mma.vim :
  # directory (if it does not exist) mkdir ~ /.vim/syntax cd ~ / .vim / syntax # Download Syntax File wget https://github.com/vim-scripts/Mathematica-Syntex-File/raw/master/syntax/mma.vim   

create ~ / .vim / filetype .vim :
  "My file type file exists (" did_load_filetypes ") Endif augroup filetypedetect au! BufRead, BufNewFile * .m, * .nb setfiletype mma augroup END   

Note: In Windows, ~ / .vim to Micro Change: \ Program Files \ vim \ vimfiles

Comments