Alex Rivera | Logout

Vim: Highlight C++ variables using scope?

Asked 2011-02-16T21:01:36.340
10

I would like to have C++ variables highlighted by scope. E.g. variables should have different coloring depending on file, class, global or local scope. Is it possible?

UPDATE: External helpers (e.g. ctags/clang and vim scripts) are welcome.

UPDATE 2: This really should be possible using libclang. Take a look at Doug Gregor presentations here: http://llvm.org/devmtg/2010-11/ I think just no one has done it yet... or?

Edit
Report

1 Answer

3

http://www.vim.org/scripts/script.php?script_id=2646

From the script website:

This set of scripts is designed to increase the number of highlighting groups used by Vim. This makes it quicker and easier to spot errors in your code. By using ctags and parsing the output, the typedefs, #defines, enumerated names etc are all clearly highlighted in different colors.

There are some screenshots available to show the comparison.

http://sites.google.com/site/abudden/contents/Vim-Scripts/ctags-highlighting

answered 2011-02-17T14:21:49.867

Your Answer