2022-03-31 07:46:45 -07:00
|
|
|
-- Neovim filetype plugin file
|
2024-01-28 18:53:14 -07:00
|
|
|
-- Language: Treesitter query
|
2024-07-03 00:24:12 -07:00
|
|
|
-- Last Change: 2024 Jul 03
|
2023-04-29 09:22:26 -07:00
|
|
|
|
|
|
|
if vim.b.did_ftplugin == 1 then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
-- Do not set vim.b.did_ftplugin = 1 to allow loading of ftplugin/lisp.vim
|
|
|
|
|
|
|
|
-- use treesitter over syntax
|
|
|
|
vim.treesitter.start()
|
|
|
|
|
2023-04-30 02:01:54 -07:00
|
|
|
-- set omnifunc
|
|
|
|
vim.bo.omnifunc = 'v:lua.vim.treesitter.query.omnifunc'
|
|
|
|
|
2023-08-25 11:17:36 -07:00
|
|
|
vim.opt_local.iskeyword:append('.')
|
|
|
|
|
2023-04-29 09:22:26 -07:00
|
|
|
-- query linter
|
|
|
|
local buf = vim.api.nvim_get_current_buf()
|
|
|
|
local query_lint_on = vim.g.query_lint_on or { 'BufEnter', 'BufWrite' }
|
|
|
|
|
|
|
|
if not vim.b.disable_query_linter and #query_lint_on > 0 then
|
|
|
|
vim.api.nvim_create_autocmd(query_lint_on, {
|
|
|
|
group = vim.api.nvim_create_augroup('querylint', { clear = false }),
|
|
|
|
buffer = buf,
|
|
|
|
callback = function()
|
|
|
|
vim.treesitter.query.lint(buf)
|
|
|
|
end,
|
|
|
|
desc = 'Query linter',
|
|
|
|
})
|
|
|
|
end
|
2022-03-31 07:46:45 -07:00
|
|
|
|
|
|
|
-- it's a lisp!
|
2024-07-03 00:24:12 -07:00
|
|
|
vim.cmd([[runtime! ftplugin/lisp.vim]])
|
2024-07-01 02:48:09 -07:00
|
|
|
|
|
|
|
vim.b.undo_ftplugin = vim.b.undo_ftplugin .. ' | setl omnifunc< iskeyword<'
|
2024-07-03 00:24:12 -07:00
|
|
|
vim.b.undo_ftplugin = vim.b.undo_ftplugin .. ' | call v:lua.vim.treesitter.stop()'
|