vim-patch:9.1.0486: filetype: Snakemake files are not recognized

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: vim/vim#14992

82a579e15a

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
This commit is contained in:
Christian Clason 2024-06-15 10:07:36 +02:00
parent 61aabe0730
commit 4faad4a950
3 changed files with 16 additions and 0 deletions

View File

@ -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<'

View File

@ -985,6 +985,7 @@ local extension = {
smt = 'smith', smt = 'smith',
smithy = 'smithy', smithy = 'smithy',
sml = 'sml', sml = 'sml',
smk = 'snakemake',
spt = 'snobol4', spt = 'snobol4',
sno = 'snobol4', sno = 'snobol4',
sln = 'solution', sln = 'solution',
@ -1620,6 +1621,7 @@ local filename = {
['/etc/slp.spi'] = 'slpspi', ['/etc/slp.spi'] = 'slpspi',
['.slrnrc'] = 'slrnrc', ['.slrnrc'] = 'slrnrc',
['sendmail.cf'] = 'sm', ['sendmail.cf'] = 'sm',
Snakefile = 'snakemake',
['.sqlite_history'] = 'sql', ['.sqlite_history'] = 'sql',
['squid.conf'] = 'squid', ['squid.conf'] = 'squid',
['ssh_config'] = 'sshconfig', ['ssh_config'] = 'sshconfig',

View File

@ -670,6 +670,7 @@ func s:GetFilenameChecks() abort
\ 'smith': ['file.smt', 'file.smith'], \ 'smith': ['file.smt', 'file.smith'],
\ 'smithy': ['file.smithy'], \ 'smithy': ['file.smithy'],
\ 'sml': ['file.sml'], \ 'sml': ['file.sml'],
\ 'snakemake': ['file.smk', 'Snakefile'],
\ 'snobol4': ['file.sno', 'file.spt'], \ 'snobol4': ['file.sno', 'file.spt'],
\ 'solidity': ['file.sol'], \ 'solidity': ['file.sol'],
\ 'solution': ['file.sln'], \ 'solution': ['file.sln'],