blob: 53df11c6b8672d3a9745080cdcbdae6062a48027 [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)
Riley Bruins0a083062024-06-03 20:40:45 +02006" 2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring')
ChaseKnowldenbedc69f2023-08-20 19:08:28 +02007
8if exists( 'b:did_ftplugin' )
9 finish
10endif
11let b:did_ftplugin = 1
12
13let s:cpoptions_save = &cpoptions
14set cpoptions&vim
15
16" command for undo
17let b:undo_ftplugin = "setlocal formatoptions< comments< commentstring<"
18
Doug Kearns93197fd2024-01-14 20:59:02 +010019if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
ChaseKnowldenbedc69f2023-08-20 19:08:28 +020020 let b:browsefilter =
Doug Kearns93197fd2024-01-14 20:59:02 +010021 \ "QML Files (*.qml, *.qbs)\t*.qml;*.qbs\n"
22 if has("win32")
23 let b:browsefilter .= "All Files (*.*)\t*\n"
24 else
25 let b:browsefilter .= "All Files (*)\t*\n"
26 endif
27 let b:undo_ftplugin .= " | unlet! b:browsefilter"
ChaseKnowldenbedc69f2023-08-20 19:08:28 +020028endif
29
30" Set 'comments' to format dashed lists in comments.
31setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
Riley Bruins0a083062024-06-03 20:40:45 +020032setlocal commentstring=//\ %s
ChaseKnowldenbedc69f2023-08-20 19:08:28 +020033
34setlocal formatoptions-=t
35setlocal formatoptions+=croql
36
37let &cpoptions = s:cpoptions_save
38unlet s:cpoptions_save