Dart Support for Vim
dart-vim-plugin provides filetype detection, syntax highlighting, and indentation for Dart code in Vim.
Looking for an IDE experience? See the Dart Tools page.
You can use following vim commands:
Install as a typical vim plugin using your favorite approach. If you don't have a preference vim-plug is a good place to start. Below are examples for common choices, be sure to read the docs for each option.
call plug#begin() "... <snip other plugins> Plug 'dart-lang/dart-vim-plugin' call plug#end()
:PlugInstall to install the plugin.
Clone the repository into your pathogen directory.
mkdir -p ~/.vim/bundle && cd ~/.vim/bundle && \ git clone https://github.com/dart-lang/dart-vim-plugin
.vimrc contains the line
set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin() "... <snip other plugins> Plugin 'dart-lang/dart-vim-plugin' call vundle#end()
Enable HTML syntax highlighting inside Dart strings with
let dart_html_in_string=v:true (default false).
Disable highlighting of core library classes with
let dart_corelib_highlight=v:false (default true).
Enable Dart style guide syntax (like 2-space indentation) with
let dart_style_guide = 2
Enable DartFmt execution on buffer save with
let dart_format_on_save = 1