Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect original filetype ftdetect #156

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

shadowwa
Copy link
Contributor

I've redone the subtype detection completely in ftdetect.[vim|lua].
This just set the filetype as 'subtype.type' and let vim loads ftplugins and syntax file for both filetype.

I didn't add new versions of vim to the workflow of this MR but ran tests on a separate branch, you can see the results there: https://github.com/shadowwa/vim-puppet/actions/runs/10981471798
With this, I have syntax highlighting + linting from ALE + lsp from COC for the subtype lanquage.

this should close #154 and #148

Detection and filetype setting are done in ftdetect scripts
filetype is set to subtype.epuppet so ftplugin and syntax file loading
is done by (n)vim owns scripts (ftplugin.vim and syntax/synload.vim)

Added more test to detect if g:epuppet_default_subtype is defined in
.vimrc
If using
```
  'for': ['puppet', 'epuppet']
```
vim-plug load ftdetect/puppet.vim, that set filetype to 'subtype.epuppet'
then as this does not strictly match 'epuppet' vim-plug remove
vim-puppet from &rtp and syntax and ftplugin file could not be loaded.
The solution is to add a wildcard
```
  'for': ['puppet', '*epuppet']
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

epuppet type detection is not working correctly in vim 8.0
1 participant