robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

Justin M. KeyesMerge #41065 from justinmk/optionfunc4836ecad1f

master
1.0 KiB37 linesraw
1-- Neovim filetype plugin file
2-- Language:	Treesitter query
3
4if vim.b.did_ftplugin == 1 then
5  return
6end
7
8-- Do not set vim.b.did_ftplugin = 1 to allow loading of ftplugin/lisp.vim
9
10-- use treesitter over syntax
11vim.treesitter.start()
12
13-- set omnifunc
14vim.bo.omnifunc = vim.treesitter.query.omnifunc
15
16vim.api.nvim_set_option_value('iskeyword', '.', { scope = 'local', operation = 'append' })
17
18-- query linter
19local buf = vim.api.nvim_get_current_buf()
20local query_lint_on = vim.g.query_lint_on or {}
21
22if not vim.b.disable_query_linter and #query_lint_on > 0 then
23  vim.api.nvim_create_autocmd(query_lint_on, {
24    group = vim.api.nvim_create_augroup('nvim.querylint', { clear = false }),
25    buf = buf,
26    callback = function()
27      vim.treesitter.query.lint(buf)
28    end,
29    desc = 'Query linter',
30  })
31end
32
33-- it's a lisp!
34vim.cmd([[runtime! ftplugin/lisp.vim]])
35
36vim.b.undo_ftplugin = (vim.b.undo_ftplugin or '') .. '\n setl omnifunc< iskeyword<'
37vim.b.undo_ftplugin = vim.b.undo_ftplugin .. ' | call v:lua.vim.treesitter.stop()'