nextflow-vim icon indicating copy to clipboard operation
nextflow-vim copied to clipboard

Plugin not working for me

Open olavurmortensen opened this issue 6 years ago • 4 comments

I installed this plugin via the "manual" method in the README, and there's no syntax highlighting. As an example, I used the "your first script" in the Nextflow documentation, saved as a .nf file.

olavurmortensen avatar Feb 28 '19 13:02 olavurmortensen

Hello, I had the same issue, where manual install did not work. I did not try the other methods, but I figured out how to make it work (for me). I'm no expert on Vim plugins, but going off information from Writing Vim Syntax Plugins, I believe many of the settings in ~/.vimrc/ftplugin/nextflow.nim need to be put into a syntax-specific file in ~/.vimrc/syntax/nextflow.nim. I copied ~/.vimrc/ftplugin/nextflow.nim into ~/.vimrc/syntax/nextflow.nim and syntax highlighting suddenly worked. Based on information in the link, I guessed that the files should be organized as follows:

ftplugin/nextflow.nim

if exists("b:current_syntax")
  finish
endif

setlocal expandtab
setlocal shiftwidth=4
setlocal softtabstop=4
setlocal colorcolumn=80

syntax/nextflow.nim

source $VIMRUNTIME/syntax/groovy.vim

syn region  nextflowBlockString          start=+'''+ keepend end=+'''+ contains=groovySpecialChar,groovySpecialError,@Spell,nextflowELExpr,@shell
syn match nextflowELExpr "\!{.\{-}}" contained


" Nextflow specifics
syn keyword nextflowDirective afterScript beforeScript cache container cpus clusterOptions disk echo errorStrategy executor ext label maxErrors maxForks maxRetries me
syn match nextflowBlock "\v(input|output|script|shell|exec):"
syn keyword nextflowKeyword from into
syn keyword nextflowType file val process Channel
syn keyword nextflowSpecial    workflow params launchDir
syn keyword nextflowConstant   null

" Apply highlighting
let b:current_syntax = "nextflow"

hi def link nextflowELExpr            Identifier
hi def link groovyELExpr              Identifier
hi def link nextflowConstant          Constant
hi def link nextflowDirective         Statement
hi def link nextflowKeyword           Operator
hi def link nextflowType              Type
hi def link nextflowSpecial           Special
hi def link nextflowBlock             Function
hi def link nextflowBlockString       String

Again, I'm not certain that's exactly how it should be, but it's working for me now.

Hope this is helpful.

mebbert avatar Aug 14 '19 16:08 mebbert

inside nextflow-vim/syntax directory

sudo cp nextflow.vim /usr/share/vim/vim80/syntax Worked for me

kemin711 avatar Aug 21 '19 21:08 kemin711

I also had this problem...

changing:

mkdir ~/.vim/ftplugin; cp ~/nextflow-vim/syntax/nextflow.vim ~/.vim/ftplugin;

in the "manual instructions" to:

mkdir ~/.vim/syntax; cp ~/nextflow-vim/syntax/nextflow.vim ~/.vim/syntax;

solved my issues.

ahstram avatar Oct 28 '22 21:10 ahstram

This is better solution than mine.  After updating system, vim version changes, you need to add to a different version in theshared directory system directory.Adding to home eliminates the trouble of having to repeat coping Thanks. Kemin Zhou 510 862-2276

On Friday, October 28, 2022 at 02:17:48 PM PDT, Alexander Stram ***@***.***> wrote:  

I also had this problem...

changing:

mkdir ~/.vim/ftplugin; cp ~/nextflow-vim/syntax/nextflow.vim ~/.vim/ftplugin;

in the "manual instructions" to:

mkdir ~/.vim/syntax cp ~/nextflow-vim/syntax/nextflow.vim ~/.vim/syntax;

solved my issues.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

kemin711 avatar Oct 30 '22 05:10 kemin711