From 2ae15f73e90e7baa1b8111474e7e2c5313cd5cfb Mon Sep 17 00:00:00 2001 From: kalmenn Date: Sat, 8 Jun 2024 16:01:26 +0200 Subject: [PATCH] feat: Set correct filetype and shiftwidth for typst files --- init.lua | 1 + lua/filetypes.lua | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 lua/filetypes.lua diff --git a/init.lua b/init.lua index 2c39b6f..67764f9 100644 --- a/init.lua +++ b/init.lua @@ -20,5 +20,6 @@ require("lazy").setup({ { import = "plugins" } }) require("sets") require("remaps") +require("filetypes") vim.notify("starting nvim 🏕️") diff --git a/lua/filetypes.lua b/lua/filetypes.lua new file mode 100644 index 0000000..e944c7b --- /dev/null +++ b/lua/filetypes.lua @@ -0,0 +1,9 @@ +vim.filetype.add({ + extension = { + typ = function(_, bufnr) + vim.bo[bufnr].shiftwidth = 2 + vim.bo[bufnr].tabstop = 2 + return "typst" + end, + }, +})