summaryrefslogtreecommitdiffstats
path: root/ftplugin/dart.vim
blob: d6609181e6e9aff48af8be85a4a955ae3c5b0170 (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
if has_key(g:polyglot_is_disabled, 'dart')
  finish
endif

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

" Enable automatic indentation (2 spaces) if variable g:dart_style_guide is set 
if exists('g:dart_style_guide')
  setlocal expandtab
  setlocal shiftwidth=2
  setlocal softtabstop=2

  setlocal formatoptions-=t
endif

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

setlocal commentstring=//%s
let s:win_sep = (has('win32') || has('win64')) ? '/' : ''
let &l:errorformat =
  \ join([
  \   ' %#''file://' . s:win_sep . '%f'': %s: line %l pos %c:%m',
  \   '%m'
  \ ], ',')

setlocal includeexpr=dart#resolveUri(v:fname)
setlocal isfname+=:
setlocal iskeyword+=$

let b:undo_ftplugin = 'setl et< fo< sw< sts< com< cms< inex< isf<'