From 8f0cb60e882bc8838e78507bcf469e2bc2eddf23 Mon Sep 17 00:00:00 2001 From: Konrad Rudolph Date: Wed, 5 Jun 2019 13:49:16 +0000 Subject: [PATCH 1/2] Add ftplugin ftplugin controls the comment string (inheriting the setting from Groovy) and other settings (which have been removed from the syntax file). --- ftplugin/nextflow.vim | 27 +++++++++++++++++++++++++++ syntax/nextflow.vim | 6 ------ 2 files changed, 27 insertions(+), 6 deletions(-) create mode 100644 ftplugin/nextflow.vim diff --git a/ftplugin/nextflow.vim b/ftplugin/nextflow.vim new file mode 100644 index 0000000..22bf6eb --- /dev/null +++ b/ftplugin/nextflow.vim @@ -0,0 +1,27 @@ +" Vim filetype plugin file +" Language: Nextflow + +if exists('b:did_ftplugin') + finish +endif + +runtime! ftplugin/groovy.vim + +let s:cpo_save = &cpo +set cpo&vim + +setlocal expandtab +setlocal shiftwidth=4 +setlocal softtabstop=4 +setlocal colorcolumn=80 + +if exists('b:undo_ftplugin') + let b:undo_ftplugin .= ' | setl et< sw< sts< cc<' +else + let b:undo_ftplugin = 'setl et< sw< sts< cc<' +endif + +let &cpo = s:cpo_save +unlet s:cpo_save + +" vim: sw=2 diff --git a/syntax/nextflow.vim b/syntax/nextflow.vim index 66f198a..1b4fc95 100644 --- a/syntax/nextflow.vim +++ b/syntax/nextflow.vim @@ -2,11 +2,6 @@ if exists("b:current_syntax") finish endif -setlocal expandtab -setlocal shiftwidth=4 -setlocal softtabstop=4 -setlocal colorcolumn=80 - source $VIMRUNTIME/syntax/groovy.vim syn region nextflowBlockString start=+'''+ keepend end=+'''+ contains=groovySpecialChar,groovySpecialError,@Spell,nextflowELExpr,@shell @@ -43,4 +38,3 @@ hi def link nextflowSpecial Special hi def link nextflowBlock Function hi def link nextflowBlockString String - From 6f06365897ed0e74fcc26b2a28605b6157bcc4d1 Mon Sep 17 00:00:00 2001 From: Konrad Rudolph Date: Wed, 5 Jun 2019 15:04:09 +0100 Subject: [PATCH 2/2] Update README.md Fix manual installation instructions and include ftplugin --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 25b4774..605afdd 100644 --- a/README.md +++ b/README.md @@ -22,10 +22,11 @@ Extends (presumed-available) groovy syntax highlighting. ### Manual - git clone https://github.com/LukeGoodsell/nextflow-vim ~/nextflow-vim; - mkdir ~/.vim/ftdetect; mkdir ~/.vim/ftplugin; - cp ~/nextflow-vim/ftdetect/nextflow.vim ~/.vim/ftdetect; - cp ~/nextflow-vim/syntax/nextflow.vim ~/.vim/ftplugin; + git clone https://github.com/LukeGoodsell/nextflow-vim.git + for subdir in ftdetect ftplugin syntax; do + mkdir -p ~/.vim/$subdir + cp nextflow-vim/$subdir/* ~/.vim/$subdir + done ## Goals