summaryrefslogtreecommitdiffstats
path: root/ftplugin/qml.vim
blob: e61e983c431d92f085eb213be4fa5af51e8bb140 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
let files = filter(globpath(&rtp, 'ftplugin/qml.vim', 1, 1), { _, v -> v !~ "vim-polyglot" && v !~ $VIMRUNTIME && v !~ "after" })
if len(files) > 0
  exec 'source ' . files[0]
  finish
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'qml') == -1

" Vim filetype plugin file
" Language: qml
" Last change: 2014 Feb 8

if exists( 'b:did_ftplugin' )
   finish
endif
let b:did_ftplugin = 1

let s:cpoptions_save = &cpoptions
set cpoptions&vim

" command for undo
let b:undo_ftplugin =
   \ 'let b:browsefilter = "" | ' .
   \ 'setlocal ' .
   \    'comments< '.
   \    'commentstring< ' .
   \    'formatoptions< ' .
   \    'indentexpr<'

if has( 'gui_win32' )
\ && !exists( 'b:browsefilter' )
   let b:browsefilter =
      \ 'qml files (*.qml)\t*.qml\n' .
      \ 'All files (*.*)\t*.*\n'
endif

" Set 'comments' to format dashed lists in comments.
setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
setlocal commentstring=//%s

setlocal formatoptions-=t
setlocal formatoptions+=croql

let &cpoptions = s:cpoptions_save
unlet s:cpoptions_save

endif