]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(bpftrace): add indention plugin
authorStanislaw Gruszka <stf_xl@wp.pl>
Sat, 27 Dec 2025 15:37:53 +0000 (15:37 +0000)
committerChristian Brabandt <cb@256bit.org>
Sat, 27 Dec 2025 15:37:53 +0000 (15:37 +0000)
Problem:  No indention support when editing bpftrace files.
Solution: Add indention settings based on cindent with custom options.

closes: #19030

Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: Christian Brabandt <cb@256bit.org>
.github/MAINTAINERS
runtime/indent/bpftrace.vim [new file with mode: 0644]

index 94c9eff887232c9843839a47e20a95a0b4152d45..3bb7a48251f0f3089c492fa862fbdc2e56b3c16b 100644 (file)
@@ -338,6 +338,7 @@ runtime/import/dist/vimhighlight.vim                        @lacygoill
 runtime/indent/arduino.vim                             @k-takata
 runtime/indent/astro.vim                               @wuelnerdotexe
 runtime/indent/basic.vim                               @dkearns
+runtime/indent/bpftrace.vim                            @sgruszka
 runtime/indent/bst.vim                                 @tpope
 runtime/indent/cdl.vim                                 @dkearns
 runtime/indent/chatito.vim                             @ObserverOfTime
diff --git a/runtime/indent/bpftrace.vim b/runtime/indent/bpftrace.vim
new file mode 100644 (file)
index 0000000..f005497
--- /dev/null
@@ -0,0 +1,19 @@
+" Vim indent file
+" Language:     bpftrace
+" Author:       Stanislaw Gruszka <stf_xl@wp.pl>
+" Last Change:  2025 Dec 27
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+    finish
+endif
+let b:did_indent = 1
+
+setlocal noautoindent nosmartindent
+
+setlocal cindent
+setlocal cinoptions=+0,(0,[0,Ws,J1,j1,m1,>s
+setlocal cinkeys=0{,0},!^F,o,O,#0
+setlocal cinwords=
+
+let b:undo_indent = "setlocal autoindent< smartindent< cindent< cinoptions< cinkeys< cinwords<"