Skip to content

notomo/runtimetable.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

runtimetable.nvim

Create runtime files from lua table.

Example

local path = vim.fn.stdpath("data") .. "/runtimetable"
vim.opt.runtimepath:prepend(path)
vim.opt.runtimepath:append(path .. "/after")

local runtime = require("runtimetable").new(path)

runtime.syntax["test.lua"] = function()
  if vim.b.current_syntax then
    return
  end

  vim.cmd.syntax({ args = { "match", "Comment", [["^\s*#.*"]] } })

  vim.b.current_syntax = "test"
end

runtime.after.ftplugin["test.lua"] = function()
  vim.bo.commentstring = "#%s"
end

runtime.doc["test.txt"] = [[
*test.txt*

============================================================================
]]

require("runtimetable").save(runtime, { as_binary = true })

-- Created the following files:
--  - {path}/syntax/test.lua
--  - {path}/after/ftplugin/test.lua
--  - {path}/doc/test.txt

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published