blob: aa05c11bf90cc9d9c224e6782915dca7c00a4653 [file] [log] [blame]
ChaseKnowldenbedc69f2023-08-20 19:08:28 +02001" Vim filetype plugin file
2" Language: QML
3" Maintainer: Chase Knowlden <haroldknowlden@gmail.com>
4" Last Change: 2023 Aug 16
Doug Kearns93197fd2024-01-14 20:59:02 +01005" 2023 Aug 23 by Vim Project (browsefilter)
ChaseKnowldenbedc69f2023-08-20 19:08:28 +02006
7if exists( 'b:did_ftplugin' )
8 finish
9endif
10let b:did_ftplugin = 1
11
12let s:cpoptions_save = &cpoptions
13set cpoptions&vim
14
15" command for undo
16let b:undo_ftplugin = "setlocal formatoptions< comments< commentstring<"
17
Doug Kearns93197fd2024-01-14 20:59:02 +010018if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
ChaseKnowldenbedc69f2023-08-20 19:08:28 +020019 let b:browsefilter =
Doug Kearns93197fd2024-01-14 20:59:02 +010020 \ "QML Files (*.qml, *.qbs)\t*.qml;*.qbs\n"
21 if has("win32")
22 let b:browsefilter .= "All Files (*.*)\t*\n"
23 else
24 let b:browsefilter .= "All Files (*)\t*\n"
25 endif
26 let b:undo_ftplugin .= " | unlet! b:browsefilter"
ChaseKnowldenbedc69f2023-08-20 19:08:28 +020027endif
28
29" Set 'comments' to format dashed lists in comments.
30setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
31setlocal commentstring=//%s
32
33setlocal formatoptions-=t
34setlocal formatoptions+=croql
35
36let &cpoptions = s:cpoptions_save
37unlet s:cpoptions_save