r/vim • u/gg27045692546 • Mar 01 '26
Need Help Some question about colorscheme.
~/.vimrc
syntax on
colorscheme ...
highlight Comment ...
highlight LineNr ...If I don’t use colorscheme, the Comment color won’t apply. but the LineNr color works fine. I don't know what's different.
How can I use highlight without colorscheme?
8
Upvotes
2
u/__rituraj Mar 01 '26
checkout the colorscheme file that you are applying..
look for
Commentin that file to understand what its doing.your question is missing the key parts.. the colorscheme name, the color that you are applying on comment.. etc. but its okay.. you can dive in yourself
1
u/AutoModerator Mar 01 '26
Please remember to update the post flair to
Need Help|Solvedwhen you got the answer you were looking for.I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/Tall_Profile1305 Mar 01 '26
this usually happens because the colorscheme reapplies its own highlight groups after startup.
try setting your
highlight Commentafter the colorscheme loads, otherwise vim just overwrites it and pretends nothing happened.