How do I use ifdef-highlighting

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

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
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
  1. ifdef-highlighting

    #ifdef highlighting in c/c++/idl

    All those vim.org scripts also have a github version https://github.com/vim-scripts/ifdef-highlighting which I tend to use with my plugin manager (although vim.org links also work, I use https://github.com/junegunn/vim-plug but there are others that work similarly, and vim has one built in.) If you do it like this, you don't have to think about how to install it, just add something like Plug 'vim-scripts/ifdef-highlighting' and you're done.

  2. InfluxDB

    InfluxDB high-performance time series database. Collect, organize, and act on massive volumes of high-resolution data to power real-time intelligent systems.

    InfluxDB logo
  3. vim-plug

    :hibiscus: Minimalist Vim Plugin Manager

    All those vim.org scripts also have a github version https://github.com/vim-scripts/ifdef-highlighting which I tend to use with my plugin manager (although vim.org links also work, I use https://github.com/junegunn/vim-plug but there are others that work similarly, and vim has one built in.) If you do it like this, you don't have to think about how to install it, just add something like Plug 'vim-scripts/ifdef-highlighting' and you're done.

  4. vim-matchup

    vim match-up: even better % :facepunch: navigate and highlight matching words :facepunch: modern matchit and matchparen. Supports both vim and neovim + tree-sitter.

    Bonus tip, check out: https://github.com/andymass/vim-matchup then the #if(def)/#else/#endif can be jumped between using the normal mode '%' command. I think this is very helpful to find matching pairs, especially in unknown code with lots of nested preprocessor macros.

  5. vim-lsp-cxx-highlight

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

    I use coc.nvim with e.g. coc-clangd extension (with https://github.com/jackguo380/vim-lsp-cxx-highlight for extra highlighting, but that might not be necessary anymore with some recent update I think I read somewhere) which has a similar feature, but uses the compiler settings from a compile_commands.json or some configuration file to know which defines are which value, to do this kind of ifdef block highlighting.

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

  • https://np.reddit.com/r/neovim/comments/jwhf60/error_using_ccls_with_nvim/gv25dc6/

    1 project | /r/backtickbot | 19 Apr 2021
  • Should vim-matchup go into neovim core?

    1 project | /r/neovim | 5 Oct 2023
  • Help Mapping Keys

    1 project | /r/neovim | 9 Jul 2023
  • Matching of Bracket Under Cursor Not Working

    1 project | /r/neovim | 22 Apr 2023
  • Do you use the "%" motion? Do you feel it has "quirks"?

    1 project | /r/vim | 22 Feb 2023