-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
772 additions
and
602 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
-- vim: ft=lua tw=80 | ||
|
||
-- Global objects defined by the C code | ||
read_globals = { | ||
vim = { | ||
other_fields = true, | ||
fields = { | ||
b = { | ||
fields = { | ||
epuppet_subtype = { | ||
read_only = false, | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
-- Some epp files may get marked as "mason" type before this script is reached. | ||
-- Vim's own scripts.vim forces the type if it detects a `<%` at the start of | ||
-- the file. All files ending in .epp should be epuppet | ||
vim.filetype.add({ | ||
extension = { | ||
epp = | ||
function(path, bufnr) | ||
local path_wo_epp = path:sub(1,-5) | ||
local matched = vim.filetype.match({ buf = bufnr, filename = path_wo_epp }) | ||
if matched ~= nil and matched ~= 'mason' then | ||
vim.b.epuppet_subtype = matched | ||
end | ||
return 'epuppet' | ||
end, | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,23 @@ | ||
" vint: -ProhibitAutocmdWithNoGroup | ||
" Vim's own filetypes.vim runs before all ftdetect scripts (why?) and matches | ||
" detects the .pp extension as being a 'pascal' file. Since the script uses | ||
" `setf`, we can nullify the filetype detection by removing all commands bound | ||
" to BufRead and BufNewFile for .pp files with `au!`. Hopefully, if there were | ||
" any other commands set they were associated with the pascal type and we want | ||
" to get rid of them. | ||
" However, this has the effect of completely nullifying pascal type detection | ||
" for .pp files. | ||
au! BufRead,BufNewFile *.pp setfiletype puppet | ||
" Some epp files may get marked as "mason" type before this script is reached. | ||
" Vim's own scripts.vim forces the type if it detects a `<%` at the start of | ||
" the file. All files ending in .epp should be epuppet | ||
au BufRead,BufNewFile *.epp setl ft=epuppet | ||
au BufRead,BufNewFile Puppetfile setfiletype ruby | ||
" Vim has fixed puppet vs pascal detection in patch 8.2.2334 so we can rely on | ||
" their type detection from that point on. | ||
if !has('patch-8.2.2334') && !has('nvim-0.5.0') | ||
" Vim's own filetypes.vim runs before all ftdetect scripts (why?) and matches | ||
" detects the .pp extension as being a 'pascal' file. Since the script uses | ||
" `setf`, we can nullify the filetype detection by removing all commands bound | ||
" to BufRead and BufNewFile for .pp files with `au!`. Hopefully, if there were | ||
" any other commands set they were associated with the pascal type and we want | ||
" to get rid of them. | ||
" However, this has the effect of completely nullifying pascal type detection | ||
" for .pp files. | ||
au! BufRead,BufNewFile *.pp setfiletype puppet | ||
endif | ||
" Vim now has autodetection for epuppet and Puppetfile. We only need to add | ||
" autocommands for older versions of vim / neovim | ||
if !has('patch-8.2.2402') && !has('nvim-0.5.0') | ||
" Some epp files may get marked as "mason" type before this script is reached. | ||
" Vim's own scripts.vim forces the type if it detects a `<%` at the start of | ||
" the file. All files ending in .epp should be epuppet | ||
au! BufRead,BufNewFile *.epp setf epuppet | ||
au BufRead,BufNewFile Puppetfile setfiletype ruby | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.