From 870c63b3942dbc1148ef0f2defd9af710cb64f5a Mon Sep 17 00:00:00 2001 From: Mark WENG Date: Sat, 29 Mar 2025 20:24:27 +0800 Subject: [PATCH] refactor: move filetype customization from polish.lua to astrocore.lua (#31) Co-authored-by: Mark Weng --- lua/plugins/astrocore.lua | 13 +++++++++++++ lua/polish.lua | 17 ++--------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/lua/plugins/astrocore.lua b/lua/plugins/astrocore.lua index f786291..03d7441 100644 --- a/lua/plugins/astrocore.lua +++ b/lua/plugins/astrocore.lua @@ -24,6 +24,19 @@ return { virtual_text = true, underline = true, }, + -- passed to `vim.filetype.add` + filetypes = { + -- see `:h vim.filetype.add` for usage + extension = { + foo = "fooscript", + }, + filename = { + [".foorc"] = "fooscript", + }, + pattern = { + [".*/etc/foo/.*"] = "fooscript", + }, + }, -- vim options can be configured here options = { opt = { -- vim.opt. diff --git a/lua/polish.lua b/lua/polish.lua index 5b65b7d..642719f 100644 --- a/lua/polish.lua +++ b/lua/polish.lua @@ -1,18 +1,5 @@ if true then return end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE --- This will run last in the setup process and is a good place to configure --- things like custom filetypes. This is just pure lua so anything that doesn't +-- This will run last in the setup process. +-- This is just pure lua so anything that doesn't -- fit in the normal config locations above can go here - --- Set up custom filetypes -vim.filetype.add { - extension = { - foo = "fooscript", - }, - filename = { - ["Foofile"] = "fooscript", - }, - pattern = { - ["~/%.config/foo/.*"] = "fooscript", - }, -}