blob: 1ce9a0303705bfbfa5270581ddb5d6d40972eeba [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
7
8if exists("b:did_ftplugin") | finish | endif
9let b:did_ftplugin = 1
10let s:keepcpo= &cpo
11set cpo&vim
12
13setlocal commentstring=#\ %s
14setlocal comments=:#
Bram Moolenaar113cb512021-11-07 20:27:04 +000015setlocal formatoptions+=croql formatoptions-=t
Bram Moolenaar96f45c02019-10-26 19:53:45 +020016
Bram Moolenaar113cb512021-11-07 20:27:04 +000017let b:undo_ftplugin = "setl com< cms< fo<"
18
19if get(g:, "meson_recommended_style", 1)
20 setlocal expandtab
21 setlocal shiftwidth=2
22 setlocal softtabstop=2
23 let b:undo_ftplugin .= " | setl et< sts< sw<"
24endif
25
26if exists("loaded_matchit") && !exists("b:match_words")
27 let b:match_words = '\<if\>:\<elif\>:\<else\>:\<endif\>,' .
28 \ '\<foreach\>:\<break\>:\<continue\>:\<endforeach\>'
29 let b:undo_ftplugin .= " | unlet! b:match_words"
30endif
31
32if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
33 let b:browsefilter = "Meson Build Files (meson.build)\tmeson.build\n" .
34 \ "All Files (*.*)\t*.*\n"
35 let b:undo_ftplugin .= " | unlet! b:browsefilter"
36endif
Bram Moolenaar96f45c02019-10-26 19:53:45 +020037
38let &cpo = s:keepcpo
39unlet s:keepcpo