I have no idea what I'm doing

This commit is contained in:
William Ball 2024-11-20 20:17:33 -08:00
parent 9c780880fa
commit ec8579d599
4 changed files with 1 additions and 51 deletions

View file

@ -1 +0,0 @@
autocmd VimEnter,BufWinEnter,BufRead,BufNewFile *.pg setlocal filetype=perga

View file

@ -1,49 +0,0 @@
local M = {}
local is_windows
if jit ~= nil then
is_windows = jit.os == "Windows"
else
is_windows = package.config:sub(1, 1) == "\\"
end
local join_paths = function(...)
local separator
if is_windows then
separator = "\\"
else
separator = "/"
end
return table.concat({ ... }, separator)
end
function M.setup(arg)
local parser_config = require('nvim-treesitter.parsers').get_parser_configs()
parser_config.perga = {
install_info = {
url = arg['local'] and join_paths(
vim.fn.stdpath('data'),
'site',
'pack',
'packer',
'start',
'tree-sitter-perga'
) or 'https://forgejo.ballcloud.cc/wball/tree-sitter-perga',
files = { 'src/parser.c' },
branch = 'main',
},
maintainers = { '@wball' }
}
local ok, ft = pcall(require, 'filetype')
if ok then
ft.setup({
overrides = {
extensions = {
perga = 'pg',
},
},
})
end
end
return M

View file

@ -7,7 +7,7 @@
"path": ".",
"file-types": ["pg"],
"injection-regex": "^perga$",
"highlights": "queries/highlights.scm"
"highlights": "queries/perga/highlights.scm"
}
],
"metadata": {