summaryrefslogtreecommitdiffstats
path: root/ftplugin/dart.vim
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2015-12-06 11:38:02 +0100
committerAdam Stankiewicz <sheerun@sher.pl>2015-12-06 11:38:02 +0100
commit5658b62b7afb7d4855e2634d8d067cbdf1d332c9 (patch)
tree334b18c006622e75e7f6a3ed89a0091a1c8834e0 /ftplugin/dart.vim
parent938a2f1667820c0ac9d5b08d4118aaf53e76a0cb (diff)
downloadvim-polyglot-5658b62b7afb7d4855e2634d8d067cbdf1d332c9.tar.gz
vim-polyglot-5658b62b7afb7d4855e2634d8d067cbdf1d332c9.zip
Add dart language support, closes #93
Diffstat (limited to 'ftplugin/dart.vim')
-rw-r--r--ftplugin/dart.vim31
1 files changed, 31 insertions, 0 deletions
diff --git a/ftplugin/dart.vim b/ftplugin/dart.vim
new file mode 100644
index 00000000..9b2e8d32
--- /dev/null
+++ b/ftplugin/dart.vim
@@ -0,0 +1,31 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dart') == -1
+
+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'
+ \ ], ',')
+
+
+let b:undo_ftplugin = 'setl et< fo< sw< sts< com< cms<'
+
+endif