add ma syntax highlighting for logstash

This commit is contained in:
Preston Baxter 2024-01-23 22:47:19 -06:00
parent a9a7a56f74
commit 8cea69f3dc
3 changed files with 25 additions and 2 deletions

View File

@ -30,6 +30,7 @@
"nvim-ts-context-commentstring": { "branch": "main", "commit": "1277b4a1f451b0f18c0790e1a7f12e1e5fdebfee" },
"nvim-web-devicons": { "branch": "master", "commit": "8b2e5ef9eb8a717221bd96cb8422686d65a09ed5" },
"onedark": { "branch": "master", "commit": "c5476a091b0f1b4e853db91c91ff941f848a1cdd" },
"playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" },
"plenary.nvim": { "branch": "master", "commit": "55d9fe89e33efd26f532ef20223e5f9430c8b0c0" },
"refactoring.nvim": { "branch": "master", "commit": "156532476deb10b1b2a32cb38e1078b3f9951c42" },
"symbols-outline.nvim": { "branch": "master", "commit": "512791925d57a61c545bc303356e8a8f7869763c" },

View File

@ -43,6 +43,7 @@ return require('lazy').setup({
dependencies = {
'JoosepAlviste/nvim-ts-context-commentstring',
"nvim-treesitter/playground",
},
config = function()
@ -53,8 +54,28 @@ return require('lazy').setup({
sync_install = false,
highlight = { enable = true },
indent = { enable = true },
playground = { enable = true },
})
local parser_config = require "nvim-treesitter.parsers".get_parser_configs()
parser_config.logstash = {
install_info = {
url = "~/code/tree-sitter-logstash", -- local path or git repo
files = {"src/parser.c"}, -- note that some parsers also require src/scanner.c or src/scanner.cc
-- optional entries:
branch = "master", -- default branch in case of git repo if different from master
generate_requires_npm = false, -- if stand-alone parser without npm dependencies
requires_generate_from_grammar = false, -- if folder contains pre-generated src/parser.c
},
}
vim.filetype.add({
extension = {
logstash = "logstash"
}
})
vim.treesitter.language.register("logstash", "logstash")
require('ts_context_commentstring').setup {
enable_autocmd = false
}
@ -101,7 +122,7 @@ return require('lazy').setup({
branch = "master",
},
}
vim.api.nvim_create_autocmd(
--[[ vim.api.nvim_create_autocmd(
{
-- 'BufWritePre' event triggers just before a buffer is written to file.
"BufWritePre"
@ -113,7 +134,7 @@ return require('lazy').setup({
vim.lsp.buf.format()
end,
}
)
) ]]
vim.treesitter.language.register('templ', 'templ')
end,
dependencies = {

View File

@ -0,0 +1 @@
/home/pbaxter/code/tree-sitter-logstash/queries/highlights.scm