aboutsummaryrefslogtreecommitdiff
path: root/ftplugin/c.lua
diff options
context:
space:
mode:
authorA Farzat <a@farzat.xyz>2024-10-02 00:22:35 +0900
committerA Farzat <a@farzat.xyz>2024-10-02 00:22:35 +0900
commit8609c77b9c2360153436159d75c815486e463d24 (patch)
treeabd3828cdd9671818408a627524bcd28e4409178 /ftplugin/c.lua
parent7cbefbb9acea27c18718d32a3c20b87886971e8a (diff)
downloadnvim-8609c77b9c2360153436159d75c815486e463d24.tar.gz
nvim-8609c77b9c2360153436159d75c815486e463d24.zip
Add ftplugins
Diffstat (limited to 'ftplugin/c.lua')
-rw-r--r--ftplugin/c.lua10
1 files changed, 10 insertions, 0 deletions
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, {})