Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How do I get rid of the red highlighting when writing a makefile in Vim

I am writing a makefile and it keeps highlighting every word after the tab. This is an example:

enter image description here

This my .vimrc file:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

filetype indent off  
set tabstop=4
set expandtab
syntax on  
colorscheme slate
set ignorecase
set number 
set nosmartindent
set noswapfile
set list
set listchars=tab:>-,trail:`,extends:>,precedes:<
set lcs+=space:·

How can I only get rid of the red highlighting? I know :syntax off will get rid of it, but it gets rid of all sorts of color changes which are useful.

>Solution :

Where you say there is a tab, there is no tab, but four spaces (as indicated by the four dots which you have configured by setting lcs).

That’s an error and it’s why it is highlighted in red.

To fix it, insert an actual tab character instead.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading