How to make it so my variable names are highlighted?

This page summarizes the projects mentioned and recommended in the original post on /r/vim

CodeRabbit: AI Code Reviews for Developers
Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
coderabbit.ai
featured
InfluxDB high-performance time series database
Collect, organize, and act on massive volumes of high-resolution data to power real-time intelligent systems.
influxdata.com
featured
  1. nvim-treesitter

    Nvim Treesitter configurations and abstraction layer

    Vim's regex-based syntax highlighting cannot detect variables in C code. If you don't mind switching to Neovim, you can use nvim-treesitter to use tree-sitter queries to highlight C files (a default set of queries is available out of the box, which do highlight variables) instead.

  2. CodeRabbit

    CodeRabbit: AI Code Reviews for Developers. Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.

    CodeRabbit logo
  3. vim-lsp-cxx-highlight

    Discontinued Vim plugin for C/C++/ObjC semantic highlighting using cquery, ccls, or clangd

    By looking around the Web, I think you can maybe do what you want in Vim with this plugin, which requires you to setup an LSP server for C (note: I haven't tried it). Otherwise, the way Vim makes its syntax highlighting (natively) simply cannot compete with tree-sitter or LSP-based highlighting which construct the entire AST of your code, because C's syntax is too complex. There is a proposal to include an alternative syntax highlighting system, but work on it hasn't even started as far as I know, so vim-lsp-cxx-highlight and tree-sitter are really the only way to highlight identifiers in C/C++.

  4. Vim

    The official Vim repository

    By looking around the Web, I think you can maybe do what you want in Vim with this plugin, which requires you to setup an LSP server for C (note: I haven't tried it). Otherwise, the way Vim makes its syntax highlighting (natively) simply cannot compete with tree-sitter or LSP-based highlighting which construct the entire AST of your code, because C's syntax is too complex. There is a proposal to include an alternative syntax highlighting system, but work on it hasn't even started as far as I know, so vim-lsp-cxx-highlight and tree-sitter are really the only way to highlight identifiers in C/C++.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • What I've Learned About My Editing Skills

    5 projects | dev.to | 10 Dec 2024
  • Bram Moolenaar Passed Away

    2 projects | news.ycombinator.com | 5 Aug 2023
  • Inconsistent instructions on NeoVim's user manual

    2 projects | /r/neovim | 26 Feb 2023
  • How can I create a new mode in vim? My goal is to create a way for vscode users or other text editor users to code in vim with their common keyboard shortcuts (e.g. <C-z> undo, <C-c> copy, <c-v> paste, etc. )

    3 projects | /r/neovim | 12 Feb 2023
  • Looking for a C IDE better than VSCode

    5 projects | /r/C_Programming | 12 Feb 2023

Did you know that Vim Script is
the 32nd most popular programming language
based on number of references?