From 2c6762d8e61b2b0c2aefac7f2f852606b846c7c0 Mon Sep 17 00:00:00 2001 From: Daniel Lundin Date: Mon, 12 Feb 2024 15:25:27 +0100 Subject: [PATCH] nvim: add comment string for CUE files --- .config/nvim/lua/config/autocmds.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.config/nvim/lua/config/autocmds.lua b/.config/nvim/lua/config/autocmds.lua index 27e9e06..b5f7062 100644 --- a/.config/nvim/lua/config/autocmds.lua +++ b/.config/nvim/lua/config/autocmds.lua @@ -1,3 +1,16 @@ -- Autocmds are automatically loaded on the VeryLazy event -- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua -- Add any additional autocmds here + +local function augroup(name) + return vim.api.nvim_create_augroup("lazyvim_" .. name, { clear = true }) +end + +-- Set comment string for CUE files +vim.api.nvim_create_autocmd("FileType", { + group = augroup("cue"), + pattern = { "cue" }, + callback = function(ev) + vim.bo[ev.buf].commentstring = "// %s" + end, +})