From 0264870c0aa50fd4e34fb8a6b3c3c3cd88a22db7 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Wed, 9 Oct 2024 09:44:15 +0200 Subject: vim-patch:9.1.0769: filetype: MLIR files are not recognized Problem: filetype: MLIR files are not recognized Solution: Detect '*.mlir' files as mlir filetype, include a mlir filetype plugin (Wu, Zhenyu) closes: vim/vim#15826 https://github.com/vim/vim/commit/347d43bd33519ab537f77d1a8fa8ab8f9196bcb9 Co-authored-by: Wu, Zhenyu --- runtime/ftplugin/mlir.vim | 10 ++++++++++ runtime/lua/vim/filetype.lua | 1 + 2 files changed, 11 insertions(+) create mode 100644 runtime/ftplugin/mlir.vim (limited to 'runtime') diff --git a/runtime/ftplugin/mlir.vim b/runtime/ftplugin/mlir.vim new file mode 100644 index 0000000000..c6a9dc341f --- /dev/null +++ b/runtime/ftplugin/mlir.vim @@ -0,0 +1,10 @@ +" Vim filetype plugin file +" Language: MLIR + +if exists("b:did_ftplugin") | finish | endif +let b:did_ftplugin = 1 + +setl comments=:///,:// +setl commentstring=//\ %s + +let b:undo_ftplugin = "setl commentstring< comments<" diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index d3910e26eb..3d3b2a2ea1 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -752,6 +752,7 @@ local extension = { mib = 'mib', mix = 'mix', mixal = 'mix', + mlir = 'mlir', mm = detect.mm, nb = 'mma', wl = 'mma', -- cgit