Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions ftdetect/snakemake.vim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
au BufNewFile,BufRead Snakefile set syntax=snakemake
au BufNewFile,BufRead *.rules set syntax=snakemake
au BufNewFile,BufRead *.snakefile set syntax=snakemake
au BufNewFile,BufRead *.snake set syntax=snakemake
augroup VimSnakemake
autocmd!
autocmd BufNewFile,BufRead Snakefile,*.snakefile,*.snake,*.smk setlocal filetype=snakemake
augroup END
4 changes: 1 addition & 3 deletions ftplugin/snakemake.vim
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@

source $VIMRUNTIME/ftplugin/python.vim

runtime! ftplugin/python.vim
1 change: 1 addition & 0 deletions indent/snakemake.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
runtime! indent/python.vim
10 changes: 5 additions & 5 deletions syntax/snakemake.vim
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: Snakemake (extended from python.vim)
" Maintainer: Jay Hesselberth (jay.hesselberth@gmail.com)
" Last Change: 2015 Jul 1
" Last Change: 2016 Jan 23
"
" Usage
"
Expand All @@ -18,7 +18,7 @@
"

" load settings from system python.vim (7.4)
source $VIMRUNTIME/syntax/python.vim
runtime! syntax/python.vim

"
" Snakemake rules, as of version 3.3
Expand All @@ -43,15 +43,15 @@ source $VIMRUNTIME/syntax/python.vim

syn keyword pythonStatement include workdir onsuccess onerror
syn keyword pythonStatement ruleorder localrules configfile
syn keyword pythonStatement touch protected temp
syn keyword pythonStatement touch protected temp wrapper
syn keyword pythonStatement input output params message threads resources
syn keyword pythonStatement version run shell benchmark snakefile log
syn keyword pythonStatement version run shell benchmark snakefile log script
syn keyword pythonStatement rule subworkflow nextgroup=pythonFunction skipwhite

" similar to special def and class treatment from python.vim, except
" parenthetical part of def and class
syn match pythonFunction
\ "\%(\%(rule\s\|subworkflow\s\)\s*\)\@<=\h*" contained
\ "\%(\%(rule\s\|subworkflow\s\)\s*\)\@<=\h\w*" contained

syn sync match pythonSync grouphere NONE "^\s*\%(rule\|subworkflow\)\s\+\h\w*\s*"

Expand Down