extra: nvim: add autocmd to appropriately set filetype for typst files

Signed-off-by: Christoph Heiss <christoph@c8h4.io>
This commit is contained in:
Christoph Heiss 2024-03-24 21:06:57 +01:00
parent 3458f5f659
commit e1fa7b8d21
Signed by: c8h4
GPG key ID: 73D5E7FDEE3DE49A

View file

@ -92,6 +92,14 @@ vim.api.nvim_create_autocmd('FileType', {
end,
})
-- Set appropriate filetype for Typst such that treesitter can do its thing
vim.api.nvim_create_autocmd('BufReadPost', {
pattern = '*.typ',
callback = function()
vim.bo.ft = 'typst'
end,
})
-- Automatically switch between absolute and relative line numbers when
-- entering insert mode
local numbertoggle_group = vim.api.nvim_create_augroup('numbertoggle', {})