Doesn't highlight syntax of .gitconfig files
-
Notepad doesn’t highlight syntax of .gitconfig files .
It shows the file as plain-text.
I know that I can fix it manually (menu Language) but I need Notepad++ to detect it automatically according to file extension.
Hm…
I’ve just found that on my first workstation it happens but doesn’t happen on another workstation.
I’ve found difference between default settings in Style Configurator.
By default it has only “properties” extension.
But another workstation with the same version of Npp has these default extensions (and gitconfig amidst):
properties conf cfg gitattributes gitconfig gitmodules editorconfigHow to explain it? what’s the reason?
-
If I were you, I’d try putting
gitconfig
in the User ext. box. -
@Anton said in Doesn't highlight syntax of .gitconfig files:
But another workstation with the same version of Npp has these default extensions…
How to explain it? what’s the reason?Before Notepad++ v8.4.8, the “Properties file” filetype only had default extensions of
.properties
(as shown as Default ext.:properties
in your screenshot, which is stored inlangs.xml
). Starting in v8.4.8, it has a longer list of extensions by default (Default ext.:properties conf cfg gitattributes gitconfig gitmodules editorconfig
). [1]However, if on one machine, you had installed with an older version and then upgraded to a more recent version, it wouldn’t have updated
langs.xml
(because Notepad++ does its best to not overwrite your customized config files), so you could have the same version (for example, v8.5.7) on both machines now, but since one started before v8.4.8, and the other started after v8.4.8, one shows the newer config and the other does not.If you ever want to reset to the “official”
langs.xml
, you can close Notepad++, delete%AppData%\notepad++\langs.xml
, and restart Notepad++: it will re-createlangs.xml
from thelangs.model.xml
in your installation directory, which will be the version of that config file that ships with Notepad++ of the specific version you’re using – at the expense that if you’d customized anything inlangs.xml
, that customization will be gone.You can also do something like use the ComparePlus plugin to compare
%AppData%\notepad++\langs.xml
in the left view toc:\program files\Notepad++\langs.model.xml
in the right, and see where the differences are, and then copy over just the new features that you want fromlangs.model.xml
, without getting rid of your customizations. But that takes more effort on your part. -
@PeterJones thanks!