robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

Christian Clasonvim-patch:9.1.0464: no whitespace padding in commentstring option in ftplugins2f5b8a0092

master
1.0 KiB38 linesraw
1" Vim filetype plugin file
2" Language: QML
3" Maintainer: Chase Knowlden <haroldknowlden@gmail.com>
4" Last Change: 2023 Aug 16
5" 	       2023 Aug 23 by Vim Project (browsefilter)
6" 	       2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring')
7
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
19if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
20   let b:browsefilter =
21      \ "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"
28endif
29
30" Set 'comments' to format dashed lists in comments.
31setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
32setlocal commentstring=//\ %s
33
34setlocal formatoptions-=t
35setlocal formatoptions+=croql
36
37let &cpoptions = s:cpoptions_save
38unlet s:cpoptions_save