From a250c640f9b0c0818d010bc6e2cceb68c0539c6c Mon Sep 17 00:00:00 2001 From: Ethan Holz Date: Thu, 6 Aug 2026 12:51:48 -0600 Subject: [PATCH] refactor: use vim.filetype.add for yaml.github --- ftdetect/github_workflows.lua | 9 --------- init.lua | 8 +++++++- 2 files changed, 7 insertions(+), 10 deletions(-) delete mode 100644 ftdetect/github_workflows.lua diff --git a/ftdetect/github_workflows.lua b/ftdetect/github_workflows.lua deleted file mode 100644 index d53bb72..0000000 --- a/ftdetect/github_workflows.lua +++ /dev/null @@ -1,9 +0,0 @@ --- " File: ~/.vim/ftdetect/github_workflows.vim --- au BufRead,BufNewFile */.github/workflows/*.yml setlocal filetype=yaml.github --- au BufRead,BufNewFile */.github/workflows/*.yaml setlocal filetype=yaml.github -vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, { - pattern = { "*/.github/workflows/*.yml", "*/.github/workflows/*.yaml" }, - callback = function() - vim.bo.filetype = "yaml.github" - end, -}) diff --git a/init.lua b/init.lua index 472ec97..181f229 100644 --- a/init.lua +++ b/init.lua @@ -34,7 +34,13 @@ vim.opt.laststatus = 3 -- Persistent undos vim.opt.undofile = true -vim.filetype.add({ extension = { service = "systemd", templ = "templ" } }) +vim.filetype.add({ + extension = { service = "systemd", templ = "templ" }, + pattern = { + [".*/%.github/workflows/.*.yml"] = "yaml.github", + [".*/%.github/workflows/.*.yaml"] = "yaml.github", + }, +}) vim.opt.packpath:prepend(vim.fn.stdpath("data") .. "/site") vim.pack.add({ -- 2.51.2