blob: 17ffd5320a662c3e358994e7e7e10aaf3029719e [file] [log] [blame]
Bram Moolenaar96f45c02019-10-26 19:53:45 +02001" Vim filetype plugin file
2" Language: meson
3" License: VIM License
Bram Moolenaar3ec32172021-05-16 12:39:47 +02004" Maintainer: Liam Beguin <liambeguin@gmail.com>
Bram Moolenaar96f45c02019-10-26 19:53:45 +02005" Original Author: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
6" Last Change: 2018 Nov 27
Doug Kearns93197fd2024-01-14 20:59:02 +01007" 2024 Jan 14 by Vim Project (browsefilter)
Bram Moolenaar96f45c02019-10-26 19:53:45 +02008
9if exists("b:did_ftplugin") | finish | endif
10let b:did_ftplugin = 1
11let s:keepcpo= &cpo
12set cpo&vim
13
14setlocal commentstring=#\ %s
15setlocal comments=:#
Bram Moolenaar113cb512021-11-07 20:27:04 +000016setlocal formatoptions+=croql formatoptions-=t
Bram Moolenaar96f45c02019-10-26 19:53:45 +020017
Bram Moolenaar113cb512021-11-07 20:27:04 +000018let b:undo_ftplugin = "setl com< cms< fo<"
19
20if 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<"
25endif
26
27if 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"
31endif
32
33if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
Doug Kearns93197fd2024-01-14 20:59:02 +010034 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
Bram Moolenaar113cb512021-11-07 20:27:04 +000040 let b:undo_ftplugin .= " | unlet! b:browsefilter"
41endif
Bram Moolenaar96f45c02019-10-26 19:53:45 +020042
43let &cpo = s:keepcpo
44unlet s:keepcpo