meson.vim (1284B)
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 9 if exists("b:did_ftplugin") | finish | endif 10 let b:did_ftplugin = 1 11 let s:keepcpo= &cpo 12 set cpo&vim 13 14 setlocal commentstring=#\ %s 15 setlocal comments=:# 16 setlocal formatoptions+=croql formatoptions-=t 17 18 let b:undo_ftplugin = "setl com< cms< fo<" 19 20 if get(g:, "meson_recommended_style", 1) 21 setlocal expandtab 22 setlocal shiftwidth=2 23 setlocal softtabstop=2 24 let b:undo_ftplugin .= " | setl et< sts< sw<" 25 endif 26 27 if exists("loaded_matchit") && !exists("b:match_words") 28 let b:match_words = '\<if\>:\<elif\>:\<else\>:\<endif\>,' . 29 \ '\<foreach\>:\<break\>:\<continue\>:\<endforeach\>' 30 let b:undo_ftplugin .= " | unlet! b:match_words" 31 endif 32 33 if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") 34 let b:browsefilter = "Meson Build Files (meson.build)\tmeson.build\n" 35 if has("win32") 36 let b:browsefilter .= "All Files (*.*)\t*\n" 37 else 38 let b:browsefilter .= "All Files (*)\t*\n" 39 endif 40 let b:undo_ftplugin .= " | unlet! b:browsefilter" 41 endif 42 43 let &cpo = s:keepcpo 44 unlet s:keepcpo