Improved C syntax highlighting for Vim
bArray 2021-08-17 01:42:33 +0000 UTC [ - ]
[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...
app4soft 2021-08-17 06:27:58 +0000 UTC [ - ]
[0] https://twitter.com/pulkomandy/status/1426547182228971521
david2ndaccount 2021-08-17 02:46:57 +0000 UTC [ - ]
antoinealb 2021-08-17 08:37:01 +0000 UTC [ - ]
david2ndaccount 2021-08-17 16:49:15 +0000 UTC [ - ]
There’s still some project-specific stuff baked in, but that’ll show the idea.
throwaway47292 2021-08-17 12:29:13 +0000 UTC [ - ]
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...
maccard 2021-08-17 13:09:54 +0000 UTC [ - ]
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;
packetlost 2021-08-17 13:14:07 +0000 UTC [ - ]
LAC-Tech 2021-08-17 08:49:18 +0000 UTC [ - ]
tfigment 2021-08-17 09:15:46 +0000 UTC [ - ]
dspillett 2021-08-17 09:29:05 +0000 UTC [ - ]
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.
CalChris 2021-08-16 20:26:07 +0000 UTC [ - ]
Maybe in ~/.config/nvim/after/syntax/
_bohm 2021-08-16 20:41:25 +0000 UTC [ - ]
nathias 2021-08-17 09:13:11 +0000 UTC [ - ]
Shadonototro 2021-08-16 21:42:50 +0000 UTC [ - ]
other than that, looks very nice, good job!
pulkomandy 2021-08-17 10:20:41 +0000 UTC [ - ]
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.
anthk 2021-08-17 15:01:37 +0000 UTC [ - ]
JK, good luck for the author.
bern4444 2021-08-17 02:00:38 +0000 UTC [ - ]
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.
jpe90 2021-08-17 09:35:12 +0000 UTC [ - ]
phreeza 2021-08-17 09:57:58 +0000 UTC [ - ]
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?
OJFord 2021-08-17 10:34:08 +0000 UTC [ - ]
bern4444 2021-08-17 15:04:12 +0000 UTC [ - ]
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
divbzero 2021-08-17 08:00:51 +0000 UTC [ - ]
OJFord 2021-08-17 10:38:15 +0000 UTC [ - ]
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)
nathias 2021-08-17 09:13:57 +0000 UTC [ - ]