Skip to content

Latest commit

 

History

History
93 lines (67 loc) · 3.11 KB

README.md

File metadata and controls

93 lines (67 loc) · 3.11 KB

The repository is no longer supported, LSP + clangd provide the same functionality in full.

DyeVim: C++ semantic highlighting for Vim

Gitter Room Build Status codecov

Pictures worth a thousand words: DyeVim Demo DyeVim Demo Token

Features

Currently it can differentiate and higlight the following C++ idioms:

Namespace
Class, Struct, Union, TypeAlias
Variable, GlobalVariable, MemberVariable, StaticMemberVariable
Function, MemberFunction, StaticMemberFunction
FunctionParameter
Enumeration, Enumerator
TemplateParameter, TemplateNonTypeParameter
Macro, PreprocessingDirective

It also greys out the skipped ranges between #ifdef...#endif preprocessing directives. Skipped Ranges

How it works

Semantic tokens are provided by the clang, extracted by the ycmd and obtained via YouCompleteMe plugin's frontend API, so in order to work DyeVim requires YouCompleteMe plugin to be installed.

Currently I am maintaining my own forks for ycmd and YouCompleteMe with changes required for the semantic tokens to work, but I hope that in time these changes will be merged back.

Setup

DyeVim works out of box and does not require any special configuration (assuming that YouCompleteMe is up and working normal), the only requirement is that it should be added to the Vim's runtimepath after YouCompleteMe.

If you are using Vundle:

Plugin davits/YouCompleteMe
Plugin davits/DyeVim

Currently only 2 colorschemes are supported: solarized and wombat256mod. If your colorscheme is not supported DyeVim will try its best to highlight your code by adding bold and italic modifiers to the existing colors.

You can also place your own coloring scheme in the autoload/dyevim/ft/cpp directory, named your_colorscheme.vim (see existing ones as an example).

Options

The g:dyevim_timeout option

This option sets query timeout in milliseconds for the tokens and skipped ranges. Note that request is a blocking operation and for worst case scenario Vim will be blocked by the specified amount, so it is not recomended to set timeout to >50 values.

Default: 10

let g:dyevim_timeout = 10

Caveats

Since I mainly use gvim in my workflow, there is no terminal support... yet, sorry for that.

Acknowledgements

Thanks to the YouCompleteMe maintainers team for the inspiration, help and support.

I walked the path prepared by the color_coded plugin.