This file contains additional syntax highlighting that used for D development in Vim. Compared to the standard syntax highlighting for D it adds highlighting of (user defined) functions and the containers and types in the standard library (phobos).
Highlighting of class scope is disabled by default. To enable set
let g:d_class_scope_highlight = 1
Follow one of the sets of directions below and reload vim afterwards.
Install using vundle by adding
Plugin 'Sirsireesh/vim-dlang-phobos-highlighter'
to .vimrc and run :PluginInstall
.
If you have pathogen installed, and you prefer to use git submodules, run
cd ~/.vim
git submodule add http://github.com/Sirsireesh/vim-dlang-phobos-highlighter.git bundle/syntax/
If you don't have either Vundle or Pathogen installed, copy the d.vim file to .vim/after/syntax.
git clone http://github.com/Sirsireesh/vim-dlang-phobos-highlighter.git /tmp/vim-dlang-phobos-highlighter
mkdir -p ~/.vim/after/syntax/
mv /tmp/vim-dlang-phobos-highlighter/after/syntax/d.vim ~/.vim/after/syntax/d.vim
rm -rf /tmp/vim-dlang-phobos-highlighter
Vim tend to a have issues with flagging braces as errors, see for example vim-jp/vim-cpp#16. A workaround is to set
let c_no_curly_error=1
Based heavily on vim-cpp-enhanced-highlight by octol, mostly copied from there
- http://stackoverflow.com/questions/736701/class-function-names-highlighting-in-vim
- http://www.vim.org/scripts/script.php?script_id=4293
- http://www.vim.org/scripts/script.php?script_id=2224
- http://www.vim.org/scripts/script.php?script_id=1640
- http://www.vim.org/scripts/script.php?script_id=3064
Sireesh Kodali
Last update: 12 April 2017