Vim syntax highlighting disappeared for text files (.txt)
Fresh3 days ago
Mar 15, 20265907 viewsConfidence Score0%
0%
Problem
My to-do list is a plain text .txt file that I load in Vim. In .txt files Vim has always coloured hash marks (#) and the text following them on the same line, which I use to mark out urgent to-do items. The other day this highlighting disappeared and I can't for the life of me see how to restore it…
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Canonical Fix
Unverified Fix
New Fix – Awaiting Verification
Fix for: Vim syntax highlighting disappeared for text files (.txt)
Low Risk
I don't think that your Vim is broken. Try putting a hash mark (#) at the beginning of the first line in the file. When Vim sees this, it sets the filetype to conf (for a configuration file). As far as I know, Vim does not syntax color vanilla text …
Awaiting Verification
Be the first to verify this fix
Sign in to verify this fix