There is already an MLIR plugin for vim in llvm-project/mlir/utils/vim that
many people don't notice although they can be very handy. This repo is stolen
from there and adds more expanded mlir syntax.
Clone the repo:
https://github.com/chudur-budur/mlir-vim.git
cd mlir-vimand add the repo to your vim runtimepath:
:set rtp+=/path/to/your/mlir-vim/repoTo use with vim-plug, follow their instructions.
i.e. just add this repo like this in your .vimrc file:
call plug#begin()
" ...
" ... your other vim-plug plugins
" ...
Plug 'chudur-budur/mlir-vim'
call plug#end()-- mlir/utils/vim/README --
This directory contains settings for the vim editor to work on MLIR *.mlir files. It comes with filetype detection rules in the (ftdetect), syntax highlighting (syntax), some minimal sensible default settings (ftplugin) and indentation plugins (indent).
To install, copy all subdirectories to your $HOME/.vim/, or if you prefer, create symlinks to the files here.
To enable highlighting inside the Markdown docs, one can add
let g:markdown_fenced_languages = ['mlir']
to .vimrc.