Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

syntax highlighting for files without extensions

I am working an some library headers that do not have a .h or .hpp extension. Visual Studio does not give me syntax highlighting and other features for those files. Is there any way to turn them on?

like image 530
fredoverflow Avatar asked Aug 11 '11 13:08

fredoverflow


People also ask

How do I turn on syntax highlighting?

After opening login.sh file in vim editor, press ESC key and type ':syntax on' to enable syntax highlighting. The file will look like the following image if syntax highlighting is on. Press ESC key and type, “syntax off” to disable syntax highlighting.

Does Visual Studio have syntax highlighting?

Syntax highlighting determines the color and style of source code displayed in the Visual Studio Code editor. It is responsible for colorizing keywords like if or for in JavaScript differently than strings and comments and variable names.

How do I disable syntax highlighting in VS Code?

You can enable / disable semantic highlighting in the VS Code settings. Press F1 to open the command window, and then enter "Open Settings (UI)". Search "semantic" to find the Editor>Semantic Highlighting item . Set the value to true to enable semantic highlighting; otherwise set it to false .


2 Answers

Found it. In the German version of Visual Studio, the option can be found under "Extras / Optionen /Text-Editor / Dateierweiterung / [x] Dateien ohne Erweiterung zuordnen zu: Microsoft Visual C++".

like image 116
fredoverflow Avatar answered Oct 26 '22 03:10

fredoverflow


In Visual Studio 2015:

Tools -> Options -> Text Editor -> File Extension:

Map extensionless files to: < Microsoft Visual C++ >

enter image description here

like image 27
Zingam Avatar answered Oct 26 '22 03:10

Zingam