dart-vim-plugin provides filetype detection, syntax highlighting, and indentation for Dart code in Vim.
Looking for auto-complete, diagnostics as you type, jump to definition and other intellisense features? Try dart_language_server and a vim plugin for the Language Server Protocol such as vim-lsc.
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()
Then invoke :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
Ensure your .vimrc
contains the line execute pathogen#infect()
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