From 1d4f446575f34e3ec32fef37c1bfe9fad84df476 Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 28 Dec 2024 05:56:53 +0100 Subject: [PATCH] Set any files in /etc/caddy/conf.d to filetype=caddyfile --- options.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/options.lua b/options.lua index b02750c..f45dd35 100644 --- a/options.lua +++ b/options.lua @@ -37,4 +37,13 @@ vim.cmd([[ autocmd BufRead,BufNewFile * set autoindent noexpandtab tabstop=4 shiftwidth=4 ]]) +vim.api.nvim_create_augroup("CaddyFileType", { clear = true }) +vim.api.nvim_create_autocmd({ "BufNewFile", "BufRead" }, { + pattern = "/etc/caddy/conf.d/*", + callback = function() + vim.opt_local.filetype = "caddyfile" + end, + group = "CaddyFileType", +}) +