meson.vim (1398B)
1 " Vim filetype plugin file 2 " Language: meson 3 " License: VIM License 4 " Maintainer: Liam Beguin <liambeguin@gmail.com> 5 " Original Author: Laurent Pinchart <laurent.pinchart@ideasonboard.com> 6 " Last Change: 2018 Nov 27 7 " 2024 Jan 14 by Vim Project (browsefilter) 8 " 2026 Jun 27 by Vim Project (normalize recommended style guard) 9 10 if exists("b:did_ftplugin") | finish | endif 11 let b:did_ftplugin = 1 12 let s:keepcpo= &cpo 13 set cpo&vim 14 15 setlocal commentstring=#\ %s 16 setlocal comments=:# 17 setlocal formatoptions+=croql formatoptions-=t 18 19 let b:undo_ftplugin = "setl com< cms< fo<" 20 21 if get(g:, 'meson_recommended_style', 22 \ get(g:, 'filetype_recommended_style', 1)) 23 setlocal expandtab 24 setlocal shiftwidth=2 25 setlocal softtabstop=2 26 let b:undo_ftplugin .= " | setl et< sts< sw<" 27 endif 28 29 if exists("loaded_matchit") && !exists("b:match_words") 30 let b:match_words = '\<if\>:\<elif\>:\<else\>:\<endif\>,' . 31 \ '\<foreach\>:\<break\>:\<continue\>:\<endforeach\>' 32 let b:undo_ftplugin .= " | unlet! b:match_words" 33 endif 34 35 if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") 36 let b:browsefilter = "Meson Build Files (meson.build)\tmeson.build\n" 37 if has("win32") 38 let b:browsefilter .= "All Files (*.*)\t*\n" 39 else 40 let b:browsefilter .= "All Files (*)\t*\n" 41 endif 42 let b:undo_ftplugin .= " | unlet! b:browsefilter" 43 endif 44 45 let &cpo = s:keepcpo 46 unlet s:keepcpo