diff options
| author | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2023-10-04 16:30:51 +0200 |
|---|---|---|
| committer | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2023-10-04 16:30:51 +0200 |
| commit | 5b3c29fedf2c2cc4e9da582d4cdb0a6bafbfe55d (patch) | |
| tree | 1fc4c5123fdb7683ae5ee976602b0256635e19a9 /lua | |
| parent | 60e517c96db9fc7c2bedbf04905f16cd253bf4ef (diff) | |
Use filetype instead of autocmd
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/tree-sitter-api-notation.lua | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lua/tree-sitter-api-notation.lua b/lua/tree-sitter-api-notation.lua index 184cb57..95d5bd5 100644 --- a/lua/tree-sitter-api-notation.lua +++ b/lua/tree-sitter-api-notation.lua @@ -12,9 +12,11 @@ function M.setup() branch = 'main' } } - vim.api.nvim_create_autocmd({'BufNewFile', 'BufRead'}, { - pattern = {'*.api', '*.apinotation'}, - callback = function () vim.opt.filetype = 'api_notation' end + vim.filetype.add({ + extension = { + api = 'api_notation', + apinotation = 'api_notation' + } }) end |