summaryrefslogtreecommitdiffstats
path: root/doc/dart.txt
diff options
context:
space:
mode:
Diffstat (limited to 'doc/dart.txt')
-rw-r--r--doc/dart.txt90
1 files changed, 90 insertions, 0 deletions
diff --git a/doc/dart.txt b/doc/dart.txt
new file mode 100644
index 00000000..2a3bc78e
--- /dev/null
+++ b/doc/dart.txt
@@ -0,0 +1,90 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dart') == -1
+
+*dart-vim-plugin* Dart support for Vim
+
+INTRODUCTION *dart.vim*
+
+dart-vim-plugin provides filetype detection, syntax highlighting, and
+indentation for Dart code in Vim.
+
+https://github.com/dart-lang/dart-vim-plugin
+
+TOOLS *dart-tools*
+
+An `includeexpr` is set that can read `.packages` files and resolve `package:`
+uris to a file. See |gf| for an example use.
+
+COMMANDS *dart-commands*
+
+These commands are available in buffers with the dart filetype.
+
+ *:Dart2Js*
+Runs dart2js to compile the current file. Takes the same arguments as the
+dart2js binary and always passes the path to the current file as the last
+argument.
+If there are any errors they will be shown in the quickfix window.
+
+ *:DartFmt*
+Runs dartfmt and passes the current buffer content through stdin. If the
+format is successful replaces the current buffer content with the formatted
+result. If the format is unsuccessful errors are shown in the quickfix window.
+This command does not use the file content on disk so it is safe to run with
+unwritten changes.
+Passes arguments through to dartfmt.
+
+ *:DartAnalyzer*
+Runs dartanalyzer to analyze the current file. Takes the same arguments as the
+dartanalyzer binary and always passes the path to the current file as the last
+argument.
+If there are any errors they will be shown in the quickfix window.
+
+CONFIGURATION *dart-configure*
+
+ *g:dart_html_in_string*
+Set to `v:true` to highlights HTML syntax inside Strings within Dart files.
+Default `v:false`
+
+ *g:dart_corelib_highlight*
+Set to `v:false` to disable highlighting of code Dart classes like `Map` or
+`List`.
+Default `v:true`
+ *g:dart_style_guide*
+Set to any value (set to `2` by convention) to set tab and width behavior to
+match the Dart style guide - spaces only with an indent of 2. Also sets
+`formatoptions += t` to auto wrap text.
+
+Configure DartFmt options with `let g:dartfmt_options`, for example, enable
+auto syntax fixes with `let g:dartfmt_options = ['--fix']`
+(discover formatter options with `dartfmt -h`)
+
+
+SYNTAX HIGHLIGHTING *dart-syntax*
+
+This plugin uses narrow highlight groups to allow selectively disabling the
+syntax highlights. Link any of the following groups to the `Normal` highlight
+group to disable them:
+
+`dartSdkException`: Capitalized exception or error classes defined in the SDK.
+
+`dartCoreType`: `void`, `var`, `dynamic`
+
+`dartSdkClass`: Capitalized classes defined in the SDK, along with `bool`,
+`int`, `double`, and `num`.
+
+`dartUserType`: Any capitalized identifier.
+
+`dartType`: Combines `dartCoreType`, `dartSdkClass`, and `dartUserType`.
+
+`dartSdkTypedef`: SDK defined `typdef`s.
+
+`dartFunction`: Any lower cased identifier preceding an open parenthesis.
+
+For example, to remove the highlighting for type and function names:
+>
+ highlight link dartType Normal
+ highlight link dartFunction Normal
+<
+
+ vim:tw=78:sw=4:ts=8:ft=help:norl:
+
+endif