All Projects β†’ jackguo380 β†’ Vim Lsp Cxx Highlight

jackguo380 / Vim Lsp Cxx Highlight

Licence: mit
Vim plugin for C/C++/ObjC semantic highlighting using cquery, ccls, or clangd

Programming Languages

c
50402 projects - #5 most used programming language
cpp
1120 projects
cxx
24 projects

Projects that are alternatives of or similar to Vim Lsp Cxx Highlight

Rigel
🌌 Colorscheme for vim, terminal, vscode and slack - based on the star Rigel ✨.
Stars: ✭ 324 (+40.26%)
Mutual labels:  neovim, vim-plugin, nvim
vim-lamp
πŸ’‘Language Server Protocol client for Vim.
Stars: ✭ 34 (-85.28%)
Mutual labels:  vim-plugin, language-server-protocol, nvim
Ncm R
R autocompletion for Neovim and vim 8 πŸ“ πŸ“Š ⚑️
Stars: ✭ 102 (-55.84%)
Mutual labels:  neovim, vim-plugin, nvim
Spaceduck
πŸš€ πŸ¦† An intergalactic space theme for Vim, Terminal, and more!
Stars: ✭ 177 (-23.38%)
Mutual labels:  neovim, vim-plugin, nvim
Vimrc
πŸ“ Vim Configuration for nerds with vim-plug
Stars: ✭ 33 (-85.71%)
Mutual labels:  neovim, vim-plugin, nvim
Vista.vim
🌡 Viewer & Finder for LSP symbols and tags
Stars: ✭ 1,218 (+427.27%)
Mutual labels:  language-server-protocol, neovim, vim-plugin
Nvim Lspconfig
Quickstart configurations for the Nvim LSP client
Stars: ✭ 3,410 (+1376.19%)
Mutual labels:  language-server-protocol, neovim, nvim
Vim Yoink
Vim plugin that maintains a yank history to cycle between when pasting
Stars: ✭ 225 (-2.6%)
Mutual labels:  neovim, nvim
Vim Janah
Vim colorscheme.
Stars: ✭ 172 (-25.54%)
Mutual labels:  neovim, vim-plugin
Animate.vim
A Vim Window Animation Library
Stars: ✭ 173 (-25.11%)
Mutual labels:  neovim, vim-plugin
Visual Split.vim
Vim plugin to control splits with visual selections or text objects
Stars: ✭ 190 (-17.75%)
Mutual labels:  neovim, vim-plugin
Vim Sayonara
πŸ‘Ί Sane buffer/window deletion.
Stars: ✭ 219 (-5.19%)
Mutual labels:  neovim, vim-plugin
Neotex
latex live preview - plugin for neovim and vim 8
Stars: ✭ 170 (-26.41%)
Mutual labels:  neovim, vim-plugin
Kommentary
Neovim commenting plugin, written in lua.
Stars: ✭ 172 (-25.54%)
Mutual labels:  neovim, nvim
Vim Subversive
Vim plugin providing operator motions to quickly replace text
Stars: ✭ 168 (-27.27%)
Mutual labels:  neovim, nvim
Vim Sneak
The missing motion for Vim πŸ‘Ÿ
Stars: ✭ 2,467 (+967.97%)
Mutual labels:  neovim, nvim
Vim Dadbod Completion
Database autocompletion powered by https://github.com/tpope/vim-dadbod
Stars: ✭ 163 (-29.44%)
Mutual labels:  neovim, vim-plugin
Nvim Config
My custom Neovim configuration with full battery for Python, C++, Markdown, LaTeX and more...
Stars: ✭ 176 (-23.81%)
Mutual labels:  neovim, nvim
Indent Blankline.nvim
Indent guides for Neovim
Stars: ✭ 203 (-12.12%)
Mutual labels:  neovim, vim-plugin
Twf
Standalone tree view file explorer, inspired by fzf.
Stars: ✭ 196 (-15.15%)
Mutual labels:  neovim, nvim

vim-lsp-cxx-highlight

vim-lsp-cxx-highlight is a vim plugin that provides C/C++/Cuda/ObjC semantic highlighting using the language server protocol.

Introduction

How does this plugin differentiate itself from color_coded and chromatica?

vim-lsp-cxx-highlight does no compilation/analysis of source files. It receives all of its semantic highlighting data over the language server protocol. The main advantage of this plugin is that it is written entirely in vimscript.

The idea for this came from vscode-cquery and seeing how it uses cquery to provide semantic highlighting.

Left: No Plugin, Right: vim-lsp-cxx-highlight + ccls

Left: No Plugin, Right: vim-lsp-cxx-highlight + ccls

Requirements

The plugin requires vim or neovim. For vim +timers and +byte_offset are recommended but not required.

Additionally a compatible language server and language server client is required.

The following language servers and protocol extensions are supported:

  • cquery

    • $cquery/publishSemanticHighlighting - semantic highlighting
    • $cquery/setInactiveRegions - preprocessor skipped regions
  • ccls

    • $ccls/publishSemanticHighlight - semantic highlighting
    • $ccls/publishSkippedRegions - preprocessor skipped regions
  • clangd

The following language server clients are supported:

Install

Using vim-plug (Or use the plugin manager of your choice)

Plug 'prabirshrestha/vim-lsp' " vim-lsp
" or
Plug 'autozimu/LanguageClient-neovim' " LanguageClient-neovim
" or
Plug 'neoclide/coc.nvim' " coc.nvim
" or
Plug 'neovim/nvim-lsp' " nvim-lsp

Plug 'jackguo380/vim-lsp-cxx-highlight'

For cquery the following initializationOptions are needed:

{
    "highlight": { "enabled" : true },
    "emitInactiveRegions" : true
}

For ccls the following initializationOptions are needed:

{
    "highlight": { "lsRanges" : true }
}

For clangd coc-settings.json must have:

{
    "clangd.semanticHighlighting": true
}

For a sample vim-lsp configuration see this

For a sample LanguageClient-neovim configuration see this

For a sample coc.nvim coc-settings.json see this

For a sample nvim-lsp configuration see this

Configuration

The plugin should work without any additional configuration. But if you don't like the default settings see :help vim-lsp-cxx-highlight

Vim Text Properties

vim-lsp-cxx-highlight now has support for Vim 8.1's text properties (See :help textprop).

What using text-properties improves:

  • Highlighting moves around with the text, inserting new lines/words no longer messes things up
  • Deleting lines removes highlighting attached to text
  • Some performance improvements? (Unverified)

Support for this feature has been tested on Vim version 8.1.1722, older versions may have problems. It is recommended to upgrade to this version or newer.

To enable:

let g:lsp_cxx_hl_use_text_props = 1

Note: This is now automatically enabled for vim version 8.2 or greater

This is a experimental feature so it may be quite buggy, please file bug reports!

License

MIT License

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].