]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.0486: filetype: Snakemake files are not recognized v9.1.0486
authorRiley Bruins <ribru17@hotmail.com>
Fri, 14 Jun 2024 18:47:05 +0000 (20:47 +0200)
committerChristian Brabandt <cb@256bit.org>
Fri, 14 Jun 2024 18:47:05 +0000 (20:47 +0200)
Problem:  filetype: Snakemake files are not recognized
Solution: Detect '*.smk' and Snakefile files as snakemake filetype
          (Riley Bruins)

See:
https://snakemake.readthedocs.io/en/stable/snakefiles/deployment.html#distribution-and-reproducibility

closes: #14992

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Riley Bruins <ribru17@hotmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
.github/MAINTAINERS
runtime/filetype.vim
runtime/ftplugin/snakemake.vim [new file with mode: 0644]
src/testdir/test_filetype.vim
src/version.c

index 926dc07cf0a4e7c3ba5a49f395df9bb4069b4413..1254782e367380db3078ff42ac8b3de9a4956de3 100644 (file)
@@ -225,6 +225,7 @@ runtime/ftplugin/sdoc.vim           @gpanders
 runtime/ftplugin/sed.vim               @dkearns
 runtime/ftplugin/sh.vim                        @dkearns
 runtime/ftplugin/slint.vim             @ribru17
+runtime/ftplugin/snakemake.vim         @ribru17
 runtime/ftplugin/solidity.vim          @cothi
 runtime/ftplugin/solution.vim          @dkearns
 runtime/ftplugin/spec.vim              @ignatenkobrain
index 801a8f346d28db24b644f773f2f67542ad6df466..a2daf144c71ba788accc1296e35d8e682d081dc9 100644 (file)
@@ -2243,6 +2243,9 @@ au BufNewFile,BufRead *.smt,*.smith               setf smith
 " Smithy
 au BufNewFile,BufRead *.smithy                 setf smithy
 
+" Snakemake
+au BufNewFile,BufRead Snakefile,*.smk          setf snakemake
+
 " Snobol4 and spitbol
 au BufNewFile,BufRead *.sno,*.spt              setf snobol4
 
diff --git a/runtime/ftplugin/snakemake.vim b/runtime/ftplugin/snakemake.vim
new file mode 100644 (file)
index 0000000..ab90ca1
--- /dev/null
@@ -0,0 +1,13 @@
+" Vim filetype plugin
+" Language:    snakemake
+" Maintainer:  Riley Bruins <ribru17@gmail.com>
+" Last Change: 2024 Jun 13
+
+if exists('b:did_ftplugin')
+  finish
+endif
+let b:did_ftplugin = 1
+
+setl comments=:# commentstring=#\ %s
+
+let b:undo_ftplugin = 'setl com< cms<'
index 284a55fe6a37a3333712adae38f26aa727c9d5b0..c43eda78f21724a0875b3442ffbb4fa3d73b06dc 100644 (file)
@@ -669,6 +669,7 @@ def s:GetFilenameChecks(): dict<list<string>>
     smith: ['file.smt', 'file.smith'],
     smithy: ['file.smithy'],
     sml: ['file.sml'],
+    snakemake: ['file.smk', 'Snakefile'],
     snobol4: ['file.sno', 'file.spt'],
     solidity: ['file.sol'],
     solution: ['file.sln'],
index 7c8a10142e8940eb2657c188a442064f862a870c..1035b606d3a24cc0e22417cc43230a6014ba7f39 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    486,
 /**/
     485,
 /**/