Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to know which syntax highlighting is being used in vim?

Tags:

vi

Newbie here. I opened a file without any extension with VIM, and its syntax is highlighted. I want to know which command will show me that which syntax highlighting is being used? i.e., is this a C++ highlighting or C highlighting....?

like image 583
Daniel Avatar asked Jan 27 '26 13:01

Daniel


1 Answers

VIM tries to automatically detect file type by default. To see which file type is currently detected type (in command mode):

:set filetype?

to set it to any particular type:

:set filetype=<filetype>
like image 63
bolty187 Avatar answered Jan 29 '26 08:01

bolty187