Add commentstring for nix file format (#12696)

41 views
Skip to first unread message

Christian Brabandt

unread,
Aug 11, 2023, 5:15:09 PM8/11/23
to vim...@googlegroups.com
Add commentstring for nix file format (#12696)

Commit: https://github.com/vim/vim/commit/d8f981138aa04c15ff87b306e9003df8d4b09d17
Author: Keith Smiley <keithb...@gmail.com>
Date: Fri Aug 11 14:07:50 2023 -0700

Add commentstring for nix file format (https://github.com/vim/vim/issues/12696)

diff --git a/runtime/ftplugin/nix.vim b/runtime/ftplugin/nix.vim
new file mode 100644
index 000000000..d417cc780
--- /dev/null
+++ b/runtime/ftplugin/nix.vim
@@ -0,0 +1,17 @@
+" Vim filetype plugin
+" Language: nix
+" Maintainer: Keith Smiley <keithb...@gmail.com>
+" Last Change: 2023 Jul 22
+
+" Only do this when not done yet for this buffer
+if exists("b:did_ftplugin")
+ finish
+endif
+
+" Don't load another plugin for this buffer
+let b:did_ftplugin = 1
+
+let b:undo_ftplugin = "setl commentstring< comments<"
+
+setlocal comments=:#
+setlocal commentstring=#\ %s
Reply all
Reply to author
Forward
0 new messages