nvim config updates
This commit is contained in:
parent
559939e2f4
commit
adc494721a
20 changed files with 1108 additions and 30 deletions
|
|
@ -1,10 +1,27 @@
|
|||
-- TODO: migrate to `main` when it's complete and staable
|
||||
|
||||
return {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
dependencies = {
|
||||
'nvim-treesitter/nvim-treesitter-textobjects',
|
||||
'nvim-treesitter/nvim-treesitter-context'
|
||||
'nvim-treesitter/nvim-treesitter-context',
|
||||
{
|
||||
'nvim-treesitter/nvim-treesitter-textobjects',
|
||||
branch = 'master',
|
||||
}
|
||||
},
|
||||
build = ':TSUpdate',
|
||||
branch = 'master',
|
||||
build = function()
|
||||
local queries_path = vim.fn.stdpath('data') .. '/lazy/nvim-treesitter/queries/dockerfile'
|
||||
local dockerfile_queries = vim.fn.stdpath('config') .. '/treesitter/dockerfile/queries/'
|
||||
|
||||
vim.fn.system({ 'rm', '-r', queries_path })
|
||||
vim.fn.mkdir(queries_path, 'p')
|
||||
for file in vim.fs.dir(dockerfile_queries) do
|
||||
vim.fn.system({ 'cp', dockerfile_queries .. file, queries_path })
|
||||
end
|
||||
|
||||
vim.cmd('TSUpdate')
|
||||
end,
|
||||
config = function()
|
||||
vim.defer_fn(function()
|
||||
--- @diagnostic disable-next-line: missing-fields
|
||||
|
|
@ -17,6 +34,16 @@ return {
|
|||
require('treesitter-context').setup {
|
||||
max_lines = 6
|
||||
}
|
||||
|
||||
local parser_config = require('nvim-treesitter.parsers').get_parser_configs()
|
||||
parser_config.dockerfile = {
|
||||
install_info = {
|
||||
url = '/home/wzray/.config/nvim/treesitter/dockerfile',
|
||||
files = { "src/parser.c", "scanner.c" },
|
||||
generate_requires_npm = false,
|
||||
requires_generate_from_grammar = true,
|
||||
},
|
||||
}
|
||||
end, 0)
|
||||
end
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue