mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-12 16:45:46 +01:00
Add missing header to the :mkv generated ftdetect file.
This commit is contained in:
@@ -675,12 +675,15 @@ var IO = Module("io", {
|
|||||||
item.file = file;
|
item.file = file;
|
||||||
}
|
}
|
||||||
|
|
||||||
rtItems.ftdetect.template = <![CDATA[au BufNewFile,BufRead *<name>rc*,*.<fileext> set filetype=<name>]]>;
|
rtItems.ftdetect.template = // {{{
|
||||||
|
<![CDATA[" Vim filetype detection file
|
||||||
|
<header>
|
||||||
|
|
||||||
|
au BufNewFile,BufRead *<name>rc*,*.<fileext> set filetype=<name>
|
||||||
|
]]>;//}}}
|
||||||
rtItems.ftplugin.template = // {{{
|
rtItems.ftplugin.template = // {{{
|
||||||
<![CDATA[" Vim filetype plugin file
|
<![CDATA[" Vim filetype plugin file
|
||||||
" Language: <appname> configuration file
|
<header>
|
||||||
" Maintainer: <maintainer>
|
|
||||||
" Version: <version>
|
|
||||||
|
|
||||||
if exists("b:did_ftplugin")
|
if exists("b:did_ftplugin")
|
||||||
finish
|
finish
|
||||||
@@ -707,9 +710,7 @@ unlet s:cpo_save
|
|||||||
]]>;//}}}
|
]]>;//}}}
|
||||||
rtItems.syntax.template = // {{{
|
rtItems.syntax.template = // {{{
|
||||||
<![CDATA[" Vim syntax file
|
<![CDATA[" Vim syntax file
|
||||||
" Language: <appname> configuration file
|
<header>
|
||||||
" Maintainer: <maintainer>
|
|
||||||
" Version: <version>
|
|
||||||
|
|
||||||
if exists("b:current_syntax")
|
if exists("b:current_syntax")
|
||||||
finish
|
finish
|
||||||
@@ -786,29 +787,11 @@ let b:current_syntax = "<name>"
|
|||||||
let &cpo = s:cpo_save
|
let &cpo = s:cpo_save
|
||||||
unlet s:cpo_save
|
unlet s:cpo_save
|
||||||
|
|
||||||
" vim: tw=130 et ts=4 sw=4:
|
" vim: tw=130 et ts=8 sts=4 sw=4:
|
||||||
]]>;//}}}
|
]]>;//}}}
|
||||||
|
|
||||||
const { options } = modules;
|
const { options } = modules;
|
||||||
|
|
||||||
let params = {//{{{
|
|
||||||
version: config.version,
|
|
||||||
name: config.name,
|
|
||||||
appname: config.appName,
|
|
||||||
fileext: config.fileExtension,
|
|
||||||
maintainer: "Doug Kearns <dougkearns@gmail.com>",
|
|
||||||
autocommands: wrap("syn keyword " + config.name + "AutoEvent ",
|
|
||||||
keys(config.autocommands)),
|
|
||||||
commands: wrap("syn keyword " + config.name + "Command ",
|
|
||||||
array(c.specs for (c in commands.iterator())).flatten()),
|
|
||||||
options: wrap("syn keyword " + config.name + "Option ",
|
|
||||||
array(o.names for (o in options) if (o.type != "boolean")).flatten()),
|
|
||||||
toggleoptions: wrap("let s:toggleOptions = [",
|
|
||||||
array(o.realNames for (o in options) if (o.type == "boolean"))
|
|
||||||
.flatten().map(String.quote),
|
|
||||||
", ") + "]"
|
|
||||||
};//}}}
|
|
||||||
|
|
||||||
const WIDTH = 80;
|
const WIDTH = 80;
|
||||||
function wrap(prefix, items, sep) {//{{{
|
function wrap(prefix, items, sep) {//{{{
|
||||||
sep = sep || " ";
|
sep = sep || " ";
|
||||||
@@ -829,6 +812,26 @@ unlet s:cpo_save
|
|||||||
return lines.map(function (l) l.join("")).join("\n").replace(/\s+\n/gm, "\n");
|
return lines.map(function (l) l.join("")).join("\n").replace(/\s+\n/gm, "\n");
|
||||||
}//}}}
|
}//}}}
|
||||||
|
|
||||||
|
let params = { // {{{
|
||||||
|
header: ['" Language: ' + config.appName + ' configuration file',
|
||||||
|
'" Maintainer: Doug Kearns <dougkearns@gmail.com>',
|
||||||
|
'" Version: ' + config.version].join("\n"),
|
||||||
|
name: config.name,
|
||||||
|
appname: config.appName,
|
||||||
|
fileext: config.fileExtension,
|
||||||
|
maintainer: "Doug Kearns <dougkearns@gmail.com>",
|
||||||
|
autocommands: wrap("syn keyword " + config.name + "AutoEvent ",
|
||||||
|
keys(config.autocommands)),
|
||||||
|
commands: wrap("syn keyword " + config.name + "Command ",
|
||||||
|
array(c.specs for (c in commands.iterator())).flatten()),
|
||||||
|
options: wrap("syn keyword " + config.name + "Option ",
|
||||||
|
array(o.names for (o in options) if (o.type != "boolean")).flatten()),
|
||||||
|
toggleoptions: wrap("let s:toggleOptions = [",
|
||||||
|
array(o.realNames for (o in options) if (o.type == "boolean"))
|
||||||
|
.flatten().map(String.quote),
|
||||||
|
", ") + "]"
|
||||||
|
}; // }}}
|
||||||
|
|
||||||
for (let { file, template } in values(rtItems)) {
|
for (let { file, template } in values(rtItems)) {
|
||||||
try {
|
try {
|
||||||
file.write(util.compileMacro(template, true)(params));
|
file.write(util.compileMacro(template, true)(params));
|
||||||
|
|||||||
Reference in New Issue
Block a user