| 1 |
" Vim filetype plugin file |
| 2 |
" Language: meson |
| 3 |
" License: VIM License |
| 4 |
" Maintainer: Liam Beguin <[email protected]> |
| 5 |
" Original Author: Laurent Pinchart <[email protected]> |
| 6 |
" Last Change: 2018 Nov 27 |
| 7 |
|
| 8 |
if exists("b:did_ftplugin") | finish | endif |
| 9 |
let b:did_ftplugin = 1 |
| 10 |
let s:keepcpo= &cpo |
| 11 |
set cpo&vim |
| 12 |
|
| 13 |
setlocal commentstring=#\ %s |
| 14 |
setlocal comments=:# |
| 15 |
setlocal formatoptions+=croql formatoptions-=t |
| 16 |
|
| 17 |
let b:undo_ftplugin = "setl com< cms< fo<" |
| 18 |
|
| 19 |
if 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<" |
| 24 |
endif |
| 25 |
|
| 26 |
if 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" |
| 30 |
endif |
| 31 |
|
| 32 |
if (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" |
| 36 |
endif |
| 37 |
|
| 38 |
let &cpo = s:keepcpo |
| 39 |
unlet s:keepcpo |