Improved C syntax highlighting for Vim
github.com
github.com
I know its supported today natively in neovim. Not sure about regular vim or other editors/ides.
But its a massive improvement on the otherwise regex approach to syntax highlighting every editor takes.
I don't know how much (or if anything) a plugin has to do to support it, but there's some kind of python RPC thing that allows it. IME it's been install that once, and neovim plugins 'just work'. (But I have only found/tried ones that explicitly mention it.)
(Edit, this: https://github.com/roxma/vim-hug-neovim-rpc)
I thought one of the points of neovim was to support true async stuff. So in theory, it should be possible to just open the file without syntax highlights but still be able to edit?
I think vim's time is nearly over. Just as it replaced vi, neovim will replace vim.
It may not get to the ubiquity of being installed everywhere by default, but certainly as the go to cli editor on devs' work and personal machines
[1] https://github.com/pulkomandy/c.vim/blob/main/cpp.vim#L2
[2] https://github.com/pulkomandy/c.vim/blob/main/cpp.vim#L6
[3] https://github.com/pulkomandy/c.vim/commit/4159fe507815f897f...
There’s still some project-specific stuff baked in, but that’ll show the idea.
VBScript could, and occasionally was, used client-side, but it was very rare in my experience. Outside of articles pushed by MS the “same language on server and client” angle didn't hold enough water to override the “only supported by IE” issue even when IE had ~90% market share in the early 2000s.
highly recommend it, if you could try.
for example this code[1]:
// the code will run twice
bool panic = true
while (true) {
panic = !panic;
if (panic) break;
}
I can argue is easier to read without highlighting.I think colors break the flow of code in unintended ways, and mistreat comments (either overvalue with some pink color or undervalue with some toned down gray), and almost all themes make keywords extremely important.
[1] https://github.com/jackdoe/programming-for-kids/issues/3#iss...
Highlighting doesn't tell you what's important, it tells you what's different. You should find a scheme that roughly weighs what's important to you;
Maybe in ~/.config/nvim/after/syntax/
other than that, looks very nice, good job!
I did not spend time to set up a more empty vim configuration to take the screenshots.
The script does not introduce any new colors, it just changes what is highlighted as cType.
It does change the color of parentheses for "if" statements to be the same color as the keyword. I am undecided if I should keep that or not. Opinions from people not using rainbow or similar plugins are welcome.
JK, good luck for the author.