Instructions: Replace the template text and remove irrelevant text (including this line)
Describe the bug
When editing puppet configuration files of type *.pp the syntax highlighting is now pascal, rather than puppet
To Reproduce
Detailed steps to reproduce the behavior:
vim --clean file.pp
:set filetype
result output is filetype=pascal
This happens regardless of if "file.pp" exists (and is a valid puppet configuration file) or not
Expected behavior
Based on the suffix or content the filetype (and this syntax highlighting) is set to puppet.
Screenshots
Environment (please complete the following information):
Additional context
A search reviled that ANY file with a ".pp" suffix will now be though of as being "pascal"
Line 1165 of the vim82 system file "filetype.vim"
au BufNewFile,BufRead *.pas,*.pp setf pascal
However NOT all files with this suffix are pascal!
A check on the GIT blame, shows this ws added 2 months ago, by...
patch 8.2.1725: not all Pascal files are recognized
44aaf54
Currently I am overriding this with a personal workaround...
" the /usr/share/vim/vim82/filetype.vim file sets '.pp' as pascal!
au BufNewFile,BufRead *.pp setf puppet
Though previously this was not needed.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.![]()
It seems to me that as a matter of principle this should be fixed in vim-puppet (assuming that's what you're using) until such time as they decide to be included in the official runtime distribution.
However, is there an easy way to detect Puppet files from their content? I'm unfamiliar with the file format so perhaps it's easier to do for Pascal?
Just noticed this starting today as well.
@dkearns Looks like vim-puppet does set this config here
I don't think there is a easy way to say it is a puppet file. Though most puppet *.pp files are located under a directory named "Manifests".
Running "file" on the files, shows that command thinks of the *.pp files as either "ASCII text" or "C++ source, ASCII text"
The later probably from seeing "class {" strings within the file. I don't have any pascal files myself.
Basically declaring all files of name "*.pp" a particual filetype works for ME on a personal level,
but it probably should not be an assumption that is made at system level.
@dkearns No sorry I am not using vim-puppet. It is not part of the normal vim-enhanced distribution.
However having a look...
I did have a personal files "vim/ftdetect/puppet.vim" with
au BufRead,BufNewFile *.pp setf puppet
in it. This obviously what was being used previously before the system "filetype.vim" file overrode it for "pascal"
I also have a personal file... "vim/syntax/puppet.vim" providing the appropriate syntax.
So I suppose the problem boils down to that this new system "filetype.vim" seting for pascal, overrides personal "ftdetect" setting.
—
You are receiving this because you commented.
@brammool You can consider it assigned to me if you like but I probably won't get to it until next week.
—
You are receiving this because you commented.
@dkearns Thanks...
I will have a look when vim updates in my package repository
fedora 33, currently providing vim 8.2.2146-2.fc33
IN the mean time I am force all *.pp files to be puppet using
au BufNewFile,BufRead *.pp setf puppet
in my personal "filetype.vim" file.
Though I see the patch includes a new override, for your "vimrc" file ...
let filetype_pp = "puppet"
—
You are receiving this because you commented.
Okay I just checked and vim had an update to 8.2.2465 which should include the above patch 8.2.2334.
No it still does not recognise the file has being a puppet configuration file, but still thinks it is pascal.
Adding the entry
let filetype_pp="puppet"
do not help either.
Re-enabling the "filetype.vim" file entry (see previous post), as I just don't have any pascal files.
—
You are receiving this because you commented.