From 8609c77b9c2360153436159d75c815486e463d24 Mon Sep 17 00:00:00 2001 From: A Farzat Date: Wed, 2 Oct 2024 00:22:35 +0900 Subject: Add ftplugins --- ftplugin/c.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 ftplugin/c.lua (limited to 'ftplugin/c.lua') diff --git a/ftplugin/c.lua b/ftplugin/c.lua new file mode 100644 index 0000000..d6e872d --- /dev/null +++ b/ftplugin/c.lua @@ -0,0 +1,10 @@ +vim.api.nvim_buf_create_user_command(0, "ToggleComment", function() + if + require("Comment.ft").get("c", require("Comment.utils").ctype.linewise) + == "//%s" + then + require("Comment.ft").set("c", "/*%s*/") + else + require("Comment.ft").set("c", "//%s") + end +end, {}) -- cgit v1.2.3-70-g09d2