-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding an option to only highlight namespace-prefixed names #1
Comments
Something like
(with separate groups for each namespace if we want to actually check the namespace, or with a single container group just checking for a preceding |
@anntzer I gave up on such complicated syntax highlighting long time ago. I didn't really need it anyway. Have you tried color_coded? |
The main problem I have with color_coded (and other similar tools) is the need to maintain a |
There's YCM-Generator that also generates |
It does not support setuptools (https://github.com/rdnetto/YCM-Generator#requirements-and-limitations). Even if I were to write it manually, .color_coded is necessarily a static list of flags, which is not sufficient (pkg-config actually returns different paths on different build systems for me). |
Have you looked at the alternatives clighter8 or chromatica.nvim? Both are written in python. |
From a quick look, all the compiler-based projects suffer from the same issue (already mentioned above): they require a static list of compile flags (which may or may not be autogenerated via cmake/bear/etc.). This does not handle the (my) case where your compilation options are e.g. TagHighlight may or may not work, haven't looked too much into it. |
I also find it annoying to have variables like "hours", and "path" highlighted like they were special. |
I am not completely against it, but with Vim's currently shipped c.vim syntax file it just won't work most of the time. What you asked for could be accomplished with something like: syntax match cppSTLscoped "::" nextgroup=cppSTLtype
syntax keyword cppSTLtype contained hours path vector
highlight default link cppSTLtype Type Now when But the problem is the It basically says that any syntax group contained inside parentheses will be highlighted. See A workaround is to clear the already declared syntax group syntax clear cParen
syntax region cParen transparent start='(' end=')'
\ contains=ALLBUT,@cParenGroup,cCppParen,cErrInBracket,cCppBracket,@cStringGroup,@Spell,cppSTLtype Now When you look at the shipped c.vim syntax file, There is already a request to fix this |
Although commenting out cppSTLfunction helps avoiding "too colorful" highlighting, there are still a lot of possibilities for extraneous highlights, e.g. the cppSTLtype "path".
Would it be possible to add a flag to only highlight names that are prefixed by their namespace (that would probably need to use a syntax match)? Or perhaps extra points if the "using" directive is configurable, e.g. the user can note in their vimrc "treat
fs
as thestd::filesystem
namespace, so highlightfs::path
but notpath
"?Thanks.
The text was updated successfully, but these errors were encountered: